<template>
  <div class="solveManage">
    <!-- 顶部查询表单 -->
    <div class="topForm">
      <el-form ref="searchForm" :model="searchForm" label-width="70px"  :inline="true" size="mini" class="searchBox">
        <el-row>
          <el-col :span="3">
            <el-form-item label="订单号：" prop="odcCode">
              <el-input v-model="searchForm.odcCode" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="3">
            <el-form-item label="委托人：" prop="odcConsigner">
              <el-input v-model="searchForm.odcConsigner" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="3.5">
            <el-form-item label="订单状态：" prop="odcStatus">
              <el-select v-model="searchForm.odcStatus" filterable clearable>
                <el-option
                  v-for="item in statusLists"
                  :key="item.RV_LOW_VALUE"
                  :label="item.RV_CMEANING"
                  :value="item.RV_LOW_VALUE"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="3.5">
            <el-form-item label="下单时间："  prop="ordCreatetimeStart">
              <el-date-picker v-model="searchForm.ordCreatetimeStart" type="date" placeholder="选择日期时间" value-format="yyyy-MM-dd" clearable></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="3">
            <el-form-item label="~" prop="ordCreatetimeEnd" label-width="10px">
              <el-date-picker v-model="searchForm.ordCreatetimeEnd" type="date" placeholder="选择日期时间" value-format="yyyy-MM-dd" clearable></el-date-picker>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="3">
            <el-form-item label="创建人：" prop="odcCreator">
              <el-select v-model="searchForm.odcCreator" filterable clearable>
                <el-option
                  v-for="item in createUserList"
                  :key="item.ORD_CREATOR"
                  :label="item.ORD_CREATOR"
                  :value="item.ORD_CREATOR"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col> -->
          <el-col :span="4">
              <!-- <el-checkbox  v-model="searchForm.ordIshydc"   @change="checkboxChange">是否海运订舱</el-checkbox>
              <el-checkbox   v-model="searchForm.ordIsblpz"  @change="checkboxChangeA">是否配载班列</el-checkbox> -->
              <el-checkbox  v-model="searchForm.ordIshydc" true-label='Y'>是否海运订舱</el-checkbox>
              <el-checkbox   v-model="searchForm.ordIsblpz" true-label='Y'>是否配载班列</el-checkbox>
          </el-col>
          <el-col :span="1">
            <el-button  @click="search" type="primary" size="mini">查询</el-button>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <!-- 解决方案按钮组 -->
    <div class="btnBox">
      <el-button plain size="mini" type="primary" @click="add('diong')">新增订单</el-button>
      <el-button plain size="mini" type="primary" @click="edit">修改订单</el-button>
      <el-button plain size="mini" type="primary" @click="del">取消订单</el-button>
      <el-button plain size="mini" type="primary" @click="audit">订单审核</el-button>
      <el-button plain size="mini" type="primary" @click="delAudit">取消审核</el-button>
      <el-button plain size="mini" type="primary" @click="delOrder">删除订单</el-button>
      <el-button plain size="mini" type="primary" @click="shouldGet">应收费用管理</el-button>
      <el-button plain size="mini" type="primary" @click="shouldPay">应付费用管理</el-button>
    </div>
    <!-- 主页主体表格 -->
    <div class="tableBox">
      <!-- 上方解决方案表格 -->
      <div class="topTable">
        <el-table :data="mainTopTableData" border :height="mainTopHeight" :header-cell-style="{ textAlign: 'center' }"
          :cell-style="{ textAlign: 'center' }" highlight-current-row @row-click="mainTopRowClick">
          <el-table-column type="index" align="center" label=" " width="50"></el-table-column>
          <el-table-column prop="ODC_CODE" label="订单号" width="200px" show-overflow-tooltip sortable></el-table-column>
          <el-table-column prop="ORD_STATUS_NAME" label="订单状态" width="110px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ODC_CREATETIME" label="下单时间" width="180px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ODC_WORKTIME" label="作业天数" width="110px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ODC_CLT_NAME" label="客户" width="90px" show-overflow-tooltip  sortable ></el-table-column>
          <el-table-column prop="ODC_CONSIGNER" label="委托人" width="90px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="GOD_OWNER" label="货主" width="90px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ODC_LINKPERSON" label="联系人" width="90px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ODC_LINKPHONE" label="联系电话" width="140px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ODC_TEL" label="手机" width="140px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="OR_STARTPLACE" label="起始地" width="90px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="OR_ENDPLACE" label="目的地" width="90px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ODC_LOADPORT_NAME" label="起始港/站" width="110px" show-overflow-tooltip  sortable></el-table-column>
          <el-table-column prop="ODC_DESTINATIONPORT" label="目的港/站" width="110px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="OR_TRANSPORTSORT" label="运输分类" width="110px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="OR_I_E" label="进/出口" width="100px" show-overflow-tooltip sortable></el-table-column>
          <el-table-column prop="ODC_YSTOTALFEE" label="订单总金额" width="120px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="OR_SUM_WEIGHT" label="订单总重量(吨)" width="140px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ORD_COUNTPRICE" label="应收价格" width="120px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ORD_YF" label="应付价格" width="130px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ORD_ISSETTLEMENT" label="结算状态" width="130px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ORD_ISHYDC" label="是否海运订舱" width="130px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ORD_ISBLPZ" label="是否配载班列" width="130px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ORD_BLPZ_NUM" label="已配载箱个数" width="130px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ODC_SOURCE" label="来源" width="110px" show-overflow-tooltip sortable >
              <template slot-scope="scope">
                  <span v-if="scope.row.ODC_SOURCE =='OFFLINE'">线下</span>
                  <span v-if="scope.row.ODC_SOURCE =='ONLINE'">线上</span>
              </template>
          </el-table-column>
          <el-table-column prop="tayContact" label="附件" width="90px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ORD_AUDITOR" label="审核人" width="110px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ORD_AUDITTIME" label="审核时间" width="180px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ORD_AUDITDIFFERING" label="审核/拒绝原因" width="140px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ORD_CREATOR" label="创建人" width="110px" show-overflow-tooltip sortable ></el-table-column>
          <el-table-column prop="ODC_REMARK" label="备注" width="110px" show-overflow-tooltip sortable ></el-table-column>
        </el-table>
      </div>
      <!-- 分页 -->
      <div class="block">
        <el-pagination
          ref="pagination"
          small
          background
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="Pagination.currentPage"
          :page-sizes="Pagination.pageSizeList"
          :page-size="Pagination.PageSize"
          :layout="Pagination.layout"
          :total="Pagination.total">
        </el-pagination>
      </div>
      <!-- 下方解决方案明细表格 -->
      <div class="botTable">
        <el-collapse v-model="activeNames" @change="handleChange">
          <el-collapse-item title="订单详情" name="1">
            <el-tabs v-model="activeName" type="card">
              <el-tab-pane label="操作服务信息" name="first">
                <div class="optServiceInfo">
                  <el-button plain size="mini" type="success" @click="optServiceAddA">新增</el-button>
                  <el-button plain size="mini" type="danger" @click="optServiceDel">删除</el-button>
                </div>
                <el-table :data="mainBotTableData" border :height="mainBotHeight" :header-cell-style="{ textAlign: 'center' }"
                  :cell-style="{ textAlign: 'center' }" highlight-current-row @row-click="mainBotRowClick">
                  <el-table-column type="index" align="center" label=" " width="50"></el-table-column>
                  <el-table-column prop="OPT_TYPE_NAME" label="服务" show-overflow-tooltip sortable></el-table-column>
                  <el-table-column prop="OPT_STARTPLACE" label="起始地" show-overflow-tooltip sortable ></el-table-column>
                  <el-table-column prop="OPT_ENDPLACE" label="目的地" show-overflow-tooltip sortable ></el-table-column>
                  <el-table-column prop="OOP_STATUS_NAME" label="操作状态" show-overflow-tooltip  sortable ></el-table-column>
                </el-table>
              </el-tab-pane>
              <el-tab-pane label="服务动态列表" name="second">
                <div class="optServiceInfo">
                  <el-button plain size="mini" type="primary" @click="dynamicBtn">动态录入</el-button>
                  <el-button plain size="mini" type="primary" @click="dynamicEdit('diongBj')">动态编辑</el-button>
                  <el-button plain size="mini" type="primary" @click="dynamicDel">动态删除</el-button>
                  <el-button plain size="mini" type="primary" @click="dynamicYifb">一键发布</el-button>
                  <el-button plain size="mini" type="primary" @click="dynamicQxfb">取消发布</el-button>
                </div>
                <el-table :data="mainBotTableDataA" border :height="mainBotHeight" :header-cell-style="{ textAlign: 'center' }"
                  :cell-style="{ textAlign: 'center' }" highlight-current-row @selection-change="handleSelectionChange" @row-click="mainBotRowClickA">
                  <el-table-column type="index" align="center" label=" " width="50"></el-table-column>
                  <el-table-column type="selection"></el-table-column>
                  <el-table-column prop="LAC_OPTM" label="作业时间" show-overflow-tooltip sortable></el-table-column>
                  <el-table-column prop="LAC_OPPRC" label="作业动作" width="110" show-overflow-tooltip sortable ></el-table-column>
                  <el-table-column prop="LAC_ADDRESS" label="作业地点" show-overflow-tooltip sortable ></el-table-column>
                  <el-table-column prop="LAC_CONTENT" label="内容" show-overflow-tooltip  sortable ></el-table-column>
                  <el-table-column prop="LAC_CREATETM" label="操作时间" show-overflow-tooltip  sortable ></el-table-column>
                  <el-table-column prop="LAC_CREATER" label="操作员工" width="110" show-overflow-tooltip  sortable ></el-table-column>
                  <el-table-column prop="LAC_FB" label="是否发布" width="110" show-overflow-tooltip  sortable >
                      <template slot-scope="scope">
                          <span v-if="scope.row.LAC_FB =='Y'">是</span>
                          <span v-else>否</span>
                      </template>
                  </el-table-column>
                  <el-table-column prop="LAC_REMARK" label="备注" show-overflow-tooltip  sortable ></el-table-column>
                </el-table>
              </el-tab-pane>
            </el-tabs>
          </el-collapse-item>
        </el-collapse>
      </div>
    </div>

    <!-- 新增订单弹出框 -->
    <el-dialog :title="dialogTitle" :visible.sync="mainDialog" v-if="mainDialog" width="60%"  :close-on-click-modal='false' v-el-drag-dialog>
      <div class="dialogBox">
        <!-- 基础信息 -->
        <div class="basicBox">
          <div class="basicTitle">
            <div class="icon">
              <span>1</span>
            </div>
            <span class="order_span2">基础信息</span>
          </div>
          <el-form ref="basicForm"  :model="basicForm" :rules="basicRules" label-width="130px"  :inline="true" size="mini">
            <el-row>
              <el-col :span="8">
                <el-form-item label="客户:" prop="odcCltId">
                  <el-popover placement="bottom" width="500"  v-model="box"  trigger="manual">
                    <selectedComponent  :selectMsg="selectMsg" :boxtype="boxtype" @childFn='childFnw' ></selectedComponent>
                    <div class="el-input el-select el-input--mini el-input--suffix" slot="reference">
                      <el-input v-model="basicForm.odcCltId" @blur="basicClose" clearable @focus="customerMsg" size="mini"></el-input>
                      <span class="el-input__suffix">
                        <span class="el-input__suffix-inner">
                          <i class="el-select__caret el-input__icon " :class="isShow?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
                        </span>
                      </span>
                    </div>
                  </el-popover>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="委托人:" prop="odcConsigner">
                  <el-input v-model="basicForm.odcConsigner"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="货主:" prop="orGoodowner">
                  <el-input v-model="basicForm.orGoodowner"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="联系人:" prop="odcLinkperson">
                  <el-input v-model="basicForm.odcLinkperson"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="联系电话:" prop="odcLinkphone">
                  <el-input maxlength="11" v-model="basicForm.odcLinkphone"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="手机:" prop="odcTel">
                  <el-input maxlength="11" v-model="basicForm.odcTel"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="Email:" prop="odcEmail">
                  <el-input v-model="basicForm.odcEmail"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="QQ:" prop="odcQq">
                  <el-input  maxlength="10" v-model="basicForm.odcQq"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="微信:" prop="odcWechat">
                  <el-input  maxlength="20" v-model="basicForm.odcWechat"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="发货方:" prop="orShipper">
                  <el-popover placement="bottom" width="500" v-model="boxA" trigger="manual">
                    <selectedComponent :selectMsg="selectMsg" :boxtype="boxtype"  @childFn='childFnA' ></selectedComponent>
                    <div class="el-input el-select el-input--mini el-input--suffix" slot="reference">
                      <el-input v-model="basicForm.orShipper"  @blur="basicClose" clearable @focus="sendGoodsMsg" size="mini"></el-input>
                      <span class="el-input__suffix">
                        <span class="el-input__suffix-inner">
                          <i class="el-select__caret el-input__icon " :class="isShow1?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
                        </span>
                      </span>
                    </div>
                  </el-popover>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="发货方联系人:" prop="orShippercontacts">
                  <el-input v-model="basicForm.orShippercontacts"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="发货方联系方式:" prop="orShippertel">
                  <el-input v-model="basicForm.orShippertel"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="收货方:" prop="orReveivingparty">
                  <el-popover placement="bottom" width="500" v-model="boxB" trigger="manual">
                    <selectedComponent :selectMsg="selectMsg" :boxtype="boxtype"  @childFn='childFnB'></selectedComponent>
                    <div class="el-input el-select el-input--mini el-input--suffix" slot="reference">
                      <el-input v-model="basicForm.orReveivingparty"  @blur="basicClose" clearable @focus="getGoodsMsg" size="mini"></el-input>
                      <span class="el-input__suffix">
                        <span class="el-input__suffix-inner">
                          <i class="el-select__caret el-input__icon " :class="isShow2?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
                        </span>
                      </span>
                    </div>
                  </el-popover>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="收货方联系人:" prop="orReveivingpartycontacts">
                  <el-input v-model="basicForm.orReveivingpartycontacts"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="收货方联系方式:" prop="orReveivingpartytel">
                  <el-input v-model="basicForm.orReveivingpartytel"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="22">
                <el-form-item label="备注:" prop="odcRemark">
                  <el-input type="textarea" v-model="basicForm.odcRemark" style="width: 600px"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <!-- 服务信息 -->
        <div class="serveBox">
          <div class="basicTitle">
            <div class="icon">
              <span>2</span>
            </div>
            <span class="order_span2">服务信息</span>
          </div>
          <div class="serveContent">
            <div class="serveContentLeft">
              <el-form ref="serveForm" :model="serveForm" :rules="serveRules" label-width="100px"  :inline="true" size="mini">
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="解决方案:" prop="solveMethods">
                      <el-popover placement="bottom" width="500" v-model="boxC" trigger="manual">
                        <selectedComponent :selectMsg="selectMsg" @service='service'></selectedComponent>
                        <div class="el-input el-select el-input--mini el-input--suffix" slot="reference">
                          <el-input v-model="serveForm.solveMethods"  @blur="basicClose" clearable @focus="solveMethodsMsg" size="mini"></el-input>
                          <span class="el-input__suffix">
                            <span class="el-input__suffix-inner">
                              <i class="el-select__caret el-input__icon " :class="isShow3?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
                            </span>
                          </span>
                        </div>
                      </el-popover>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="作业天数:" prop="odcWorktime">
                      <el-input v-model="serveForm.odcWorktime" clearable></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="运输分类:" prop="orTransportsort">
                      <el-select v-model="serveForm.orTransportsort" filterable clearable :disabled="transPortDisabled">
                        <el-option
                          v-for="item in ysflItem"
                          :key="item.RV_LOW_VALUE"
                          :label="item.RV_CMEANING"
                          :value="item.RV_LOW_VALUE"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="进/出口:" prop="orIE">
                      <el-radio v-model="serveForm.orIE" label="I">进口</el-radio>
                      <el-radio v-model="serveForm.orIE" label="E">出口</el-radio>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="起始地:" prop="orStartplace">
                      <el-select v-model="serveForm.orStartplace" filterable clearable>
                        <el-option
                          v-for="item in placeLists"
                          :key="item.ycode"
                          :label="item.chname"
                          :value="item.ycode"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="目的地:" prop="orEndplace">
                      <el-select v-model="serveForm.orEndplace" filterable clearable>
                        <el-option
                          v-for="item in placeLists"
                          :key="item.ycode"
                          :label="item.chname"
                          :value="item.ycode"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="起始港/站:" prop="odcLoadport">
                      <el-select v-model="serveForm.odcLoadport" filterable clearable>
                        <el-option
                          v-for="item in qsgData"
                          :key="item.CODE"
                          :label="item.NAME"
                          :value="item.CODE"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="目的港/站:" prop="odcDestinationport">
                      <el-select v-model="serveForm.odcDestinationport" filterable clearable>
                        <el-option
                          v-for="item in qsgData"
                          :key="item.CODE"
                          :label="item.NAME"
                          :value="item.CODE"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
            </div>
            <!-- 箱信息 -->
            <div class="serveContentRight">
              <div class="srBtnBox">
                <el-button plain size="mini" type="success" @click="serveAdd">新增</el-button>
                <el-button plain size="mini" type="danger" @click="serveDel">删除</el-button>
              </div>
              <el-table :data="serveTableData" border :height="serveTableHeight" @row-click="mainTopRowClickA" :rules="endCarRulesB" :header-cell-style="{ textAlign: 'center' }"
                :cell-style="{ textAlign: 'center' }" highlight-current-row>
                <el-table-column type="index" align="center" label=" " width="50"></el-table-column>
                <el-table-column prop="taaCntrsize" label="尺寸" show-overflow-tooltip sortable>
                  <template slot-scope="scope">
                    <el-select v-model="scope.row.taaCntrsize" clearable size="mini" v-if="scope.row.status">
                      <el-option
                        v-for="item in ccData"
                        :key="item.cszCsizenm"
                        :label="item.cszCsizenm"
                        :value="item.cszCsizenm"
                      ></el-option>
                    </el-select>
                    <span v-else>{{scope.row.taaCntrsize}}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="taaCntrtype" label="箱型" show-overflow-tooltip sortable>
                  <template slot-scope="scope">
                    <el-select v-model="scope.row.taaCntrtype" clearable size="mini" v-if="scope.row.status">
                      <el-option
                        v-for="item in xxData"
                        :key="item.ctpCommcode"
                        :label="item.ctpCommcode"
                        :value="item.ctpCommcode"
                      ></el-option>
                    </el-select>
                    <span v-else>{{scope.row.taaCntrtype}}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="taaQuantity" label="数量" show-overflow-tooltip sortable  >
                  <template slot-scope="scope">
                    <el-form :model="scope.row" style="padding-top: 10px;">
                        <el-form-item v-if="scope.row.status"  prop='taaQuantity'
                          :rules="[{ required: true, message: '数量不能为空', trigger: ['blur', 'change']}]">
                          <el-input  v-model="scope.row.taaQuantity" clearable size="mini" ></el-input>
                        </el-form-item>
                         <span v-else>{{scope.row.taaQuantity}}</span>
                    </el-form>

                       <!-- <el-input v-if="scope.row.status" v-model="scope.row.taaQuantity" clearable size="mini" ></el-input>
                        <span v-else>{{scope.row.taaQuantity}}</span> -->
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
        </div>
        <!-- 解决方案明细 -->
        <div class="solveMethodsDetailBox">
          <div class="basicTitle">
            <div class="icon">
              <span>3</span>
            </div>
            <span class="order_span2">解决方案明细</span>
          </div>
          <!-- 解决方案表格 -->
          <el-table :data="solveTableData" border :height="solveTableHeight" :header-cell-style="{ textAlign: 'center' }"
            :cell-style="{ textAlign: 'center' }" highlight-current-row>
            <el-table-column type="index" align="center" label=" " width="50"></el-table-column>
            <el-table-column prop="STN_SERVICECODE_NAME" label="服务代码" width="110px" show-overflow-tooltip sortable></el-table-column>
            <el-table-column prop="STN_SUPPLIER_ETP_NAME" label="供应商" width="100px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_SPL_NAME" label="经营人" width="100px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_START_NAME" label="起始地" width="100px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_DESTI_NAME" label="目的地" width="90px" show-overflow-tooltip  sortable ></el-table-column>
            <el-table-column prop="STN_STARTADDRESS_NAME" label="起始港" width="90px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_DESTINATION_NAME" label="目的港" width="90px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_20GPPRICE" label="20GP价格" width="120px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_20GPCURRENCY" label="20GP币种" width="120px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_40GPPRICE" label="40GP价格" width="120px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_40GPCURRENCY" label="40GP币种" width="120px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_40HQPRICE" label="40HQ价格" width="120px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_40HQCURRENCY" label="40HQ币种" width="120px" show-overflow-tooltip  sortable></el-table-column>
            <el-table-column prop="STN_CREATOR" label="创建人" width="90px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_CREATETIME" label="创建时间" width="110px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_LSTMODIFIER" label="修改人" width="100px" show-overflow-tooltip sortable ></el-table-column>
            <el-table-column prop="STN_LSTMODIFYTIME" label="修改时间" width="110px" show-overflow-tooltip sortable ></el-table-column>
          </el-table>
        </div>
        <!-- 货物信息 -->
        <div class="goodsInfoBox">
          <div class="basicTitle">
            <div class="icon">
              <span>4</span>
            </div>
            <span class="order_span2">货物信息</span>
          </div>
          <!-- 按钮组 -->
          <div class="goodsBtnBox">
            <el-button plain size="mini" type="success" @click="goodsAdd">新增</el-button>
            <el-button plain size="mini" type="danger" @click="goodsDel">删除</el-button>
          </div>
          <!-- 解决方案表格 -->
          <el-table :data="goodsTableData" border :height="goodsTableHeight" :rules="endCarRulesA"  @row-click="mainTopRowClickAB"  :header-cell-style="{ textAlign: 'center' }"
            :cell-style="{ textAlign: 'center' }" highlight-current-row>
            <el-table-column type="index" align="center" label=" " width="50"></el-table-column>
            <el-table-column prop="godCode" label="货物分类" show-overflow-tooltip sortable>
              <template slot-scope="scope">
                <el-select v-model="scope.row.godCode" clearable size="mini" v-if="scope.row.status">
                  <el-option
                    v-for="item in hwData"
                    :key="item.PDK_CODE"
                    :label="item.PDK_NAME"
                    :value="item.PDK_CODE"
                  ></el-option>
                </el-select>
                <span v-else>{{scope.row.godCode}}</span>
              </template>
            </el-table-column>
            <el-table-column prop="godCnname" label="中文品名" show-overflow-tooltip sortable >
              <template slot-scope="scope">
                <el-form :model="scope.row" style="padding-top:10px;" >
                        <el-form-item v-if="scope.row.status"  prop='godCnname'
                          :rules="[{ required: true, message: '中文名不能为空', trigger: ['blur', 'change']}]">
                          <el-input  v-model="scope.row.godCnname" clearable size="mini" ></el-input>
                        </el-form-item>
                         <span v-else>{{scope.row.godCnname}}</span>
                  </el-form>
                  <!-- <el-input v-model="scope.row.godCnname" clearable size="mini" v-if="scope.row.status"></el-input>
                  <span v-else>{{scope.row.godCnname}}</span> -->
              </template>
            </el-table-column>
            <el-table-column prop="godInname" label="英文品名" show-overflow-tooltip sortable >
              <template slot-scope="scope">
                  <el-input v-model="scope.row.godInname" clearable size="mini" v-if="scope.row.status"></el-input>
                  <span v-else>{{scope.row.godInname}}</span>
              </template>
            </el-table-column>
            <el-table-column prop="godNum" label="件数" show-overflow-tooltip sortable >
              <template slot-scope="scope">
                <el-form :model="scope.row" style="padding-top:10px;">
                    <el-form-item v-if="scope.row.status"  prop='godNum'
                      :rules="[{ required: true, message: '件数不能为空', trigger: ['blur', 'change']}]">
                      <el-input  v-model="scope.row.godNum" clearable size="mini" ></el-input>
                    </el-form-item>
                      <span v-else>{{scope.row.godNum}}</span>
                  </el-form>
                  <!-- <el-input v-model="scope.row.godNum" clearable size="mini" v-if="scope.row.status"></el-input>
                  <span v-else>{{scope.row.godNum}}</span> -->
              </template>
            </el-table-column>
            <el-table-column prop="godWeight" label="重量(KG)"  show-overflow-tooltip  sortable >
              <template slot-scope="scope">
                <el-form :model="scope.row" style="padding-top:10px;">
                    <el-form-item v-if="scope.row.status"  prop='godWeight'
                      :rules="[{ required: true, message: '重量不能为空', trigger: ['blur', 'change']}]">
                      <el-input  v-model="scope.row.godWeight" clearable size="mini" ></el-input>
                    </el-form-item>
                      <span v-else>{{scope.row.godWeight}}</span>
                  </el-form>
                  <!-- <el-input v-model="scope.row.godWeight" clearable size="mini" v-if="scope.row.status"></el-input>
                  <span v-else>{{scope.row.godWeight}}</span> -->
              </template>
            </el-table-column>
            <el-table-column prop="godVolume" label="体积(m³)" show-overflow-tooltip sortable >
              <template slot-scope="scope">
                  <el-input v-model="scope.row.godVolume" clearable size="mini" v-if="scope.row.status"></el-input>
                  <span v-else>{{scope.row.godVolume}}</span>
              </template>
            </el-table-column>
            <el-table-column prop="godPacked" label="包装" show-overflow-tooltip sortable >
              <template slot-scope="scope">
                <el-select v-model="scope.row.godPacked" clearable size="mini" v-if="scope.row.status">
                  <el-option
                    v-for="item in bzData"
                    :key="item.RV_LOW_VALUE"
                    :label="item.RV_CMEANING"
                    :value="item.RV_LOW_VALUE"
                  ></el-option>
                </el-select>
                <span v-else>{{scope.row.godPacked}}</span>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- 拖车服务 -->
        <div class="truckServiceBox">
          <div class="basicTitle">
            <div class="icon">
              <span>5</span>
            </div>
            <span class="order_span2">拖车服务</span>
          </div>
          <!-- 发货地，目的地拖车 -->
          <div class="serviceBox">
            <!-- 发货地服务 -->
            <div class="startBox">
              <div class="startTitle">发货地服务</div>
              <el-checkbox style="padding: 0 0 10px 10px;" v-model="startChecked">拖车：</el-checkbox>
              <el-form ref="startCarForm" :model="startCarForm" :rules="startCarRules" label-width="80px" :inline="true" size="mini">
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="联系人:" prop="odcSPeople">
                      <el-input v-model="startCarForm.odcSPeople" clearable :disabled="startDisabled"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="联系电话:" prop="odcSPhone" label-width="90px">
                      <el-input v-model="startCarForm.odcSPhone" clearable :disabled="startDisabled"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="24">
                    <el-form-item label="地址:" prop="odcSProvince">
                      <el-select v-model="startCarForm.odcSProvince" filterable clearable :disabled="startDisabled" @change="provinceChange">
                        <el-option
                          v-for="item in provinceData"
                          :key="item.PRV_CODE"
                          :label="item.PRV_CHNNAME"
                          :value="item.PRV_CODE"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item prop="orDeliverypointcity">
                      <el-select style="margin-left: 10px" v-model="startCarForm.orDeliverypointcity" filterable clearable :disabled="startDisabled" @change="cityChange">
                        <el-option
                          v-for="item in cityDataA"
                          :key="item.CTYE_CODE"
                          :label="item.CTYE_CHNNAME"
                          :value="item.CTYE_CODE"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item prop="odcSArea">
                      <el-select style="margin-left: 10px" v-model="startCarForm.odcSArea" filterable clearable :disabled="startDisabled">
                        <el-option
                          v-for="item in townDataA"
                          :key="item.CITY_CODE"
                          :label="item.CTY_CHNNAME"
                          :value="item.CITY_CODE"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="24">
                    <el-form-item prop="odcSAddress" label="    " class="detailAddressBox">
                      <el-input v-model="startCarForm.odcSAddress" placeholder="请输入详细地址" clearable :disabled="startDisabled"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
            </div>
            <!-- 目的地服务 -->
            <div class="endBox">
              <div class="endTitle">目的地服务</div>
              <el-checkbox style="padding: 0 0 10px 10px;" v-model="endChecked">拖车：</el-checkbox>
              <el-form ref="endCarForm" :model="endCarForm" :rules="endCarRules" label-width="80px" :inline="true" size="mini">
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="联系人:" prop="odcDPeople">
                      <el-input v-model="endCarForm.odcDPeople" clearable :disabled="endDisabled"></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="联系电话:" prop="odcDPhone" label-width="90px">
                      <el-input v-model="endCarForm.odcDPhone" clearable :disabled="endDisabled"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="24">
                    <el-form-item label="地址:" prop="odcDProvince">
                      <el-select v-model="endCarForm.odcDProvince" filterable clearable :disabled="endDisabled"  @change="provinceChangeA">
                        <el-option
                          v-for="item in provinceData"
                          :key="item.PRV_CODE"
                          :label="item.PRV_CHNNAME"
                          :value="item.PRV_CODE"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item prop="orReveivingpartytelcity">
                      <el-select style="margin-left: 10px" v-model="endCarForm.orReveivingpartytelcity" filterable clearable :disabled="endDisabled" @change="cityChangeA">
                        <el-option
                          v-for="item in cityData"
                          :key="item.CTYE_CODE"
                          :label="item.CTYE_CHNNAME"
                          :value="item.CTYE_CODE"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item prop="odcDArea">
                      <el-select style="margin-left: 10px" v-model="endCarForm.odcDArea" filterable clearable :disabled="endDisabled">
                        <el-option
                          v-for="item in townData"
                          :key="item.CITY_CODE"
                          :label="item.CTY_CHNNAME"
                          :value="item.CITY_CODE"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="24">
                    <el-form-item prop="odcDAddress" label="    " class="detailAddressBox">
                      <el-input v-model="endCarForm.odcDAddress" placeholder="请输入详细地址" clearable :disabled="endDisabled"></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
            </div>
          </div>
        </div>
        <!-- 附件信息 -->
        <div class="attachmentInfoBox">
          <div class="basicTitle">
            <div class="icon">
              <span>6</span>
            </div>
            <span class="order_span2">附件信息</span>
          </div>
        </div>
        <!-- 协议费用信息 -->
        <div class="agreeFeeInfoBox" v-if="this.dialogStatus == 'audit' || this.dialogStatus == 'delAudit'">
          <div class="basicTitle">
            <div class="icon">
              <span>7</span>
            </div>
            <span class="order_span2">协议费用信息</span>
          </div>
          <el-form ref="agreeFeeForm" :model="agreeFeeForm" label-width="130px"  :inline="true" size="mini">
            <el-row>
              <el-col :span="24">
                <el-form-item label="客户协议:" prop="V_ODC_CLIENTXY">
                  <el-select v-model="agreeFeeForm.V_ODC_CLIENTXY" filterable clearable>
                    <el-option
                      v-for="item in agreeList"
                      :key="item.conCltId"
                      :label="item.conCltName"
                      :value="item.conCltId"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="订单总金额(RMB):" prop="V_ODC_YSTOTALFEE">
                  <el-input v-model="agreeFeeForm.V_ODC_YSTOTALFEE" clearable></el-input>
                </el-form-item>
                <el-form-item label="订单总金额(USD):" prop="orderUSD">
                  <el-input v-model="agreeFeeForm.orderUSD" clearable></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <!-- 审核信息 -->
        <div class="auditInfoBox" v-if="this.dialogStatus == 'audit' || this.dialogStatus == 'delAudit'">
          <div class="basicTitle">
            <div class="icon">
              <span>8</span>
            </div>
            <span class="order_span2">审核信息</span>
          </div>
          <div class="auditInfoBot">
            <div>审核意见：</div>
            <el-input type="textarea" v-model="V_ORD_AUDITDIFFERING" style="width: 600px"></el-input>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="mainDialog = false">关闭</el-button>
        <!-- <el-button type="primary" v-if="this.dialogStatus == 'add' || this.dialogStatus == 'edit'" @click="dialogSave">保存</el-button> -->
        <el-button size="mini" type="primary" v-if="dialogSaveA" @click="dialogSave">保存</el-button>
        <el-button size="mini" type="primary" v-if="this.dialogStatus == 'audit'" @click="dialogAudit">审核</el-button>
        <el-button size="mini" type="primary" v-if="this.dialogStatus == 'audit' || this.dialogStatus == 'delAudit'" @click="dialogRefuse">拒绝</el-button>
        <el-button size="mini" type="primary" v-if="this.dialogStatus == 'delAudit'" @click="dialogDelAudit">取消审核</el-button>
      </span>
    </el-dialog>

    <!-- 应收费用之前的判断币种弹窗 -->
    <el-dialog :title="moneyCateTitle" :visible.sync="moneyCateDialog" width="20%" style="top: 30%" :close-on-click-modal='false' v-el-drag-dialog>
      <el-radio v-model="moneyCateRadio" label="RMB">人民币</el-radio>
      <el-radio v-model="moneyCateRadio" label="USD">美元</el-radio>

      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="moneyCateDialog = false">取消</el-button>
        <el-button size="mini" type="primary" @click="moneyCateSure">确定</el-button>
      </span>
    </el-dialog>

    <!-- 应收费用弹窗 -->
    <el-dialog :title="feeDialogTitle" :visible.sync="feeDialog" width="60%" :close-on-click-modal='false' @close="dialogClose" v-el-drag-dialog>
      <div class="feeDialogBox">
        <!-- 左侧 -->
        <div class="feeLeftBox">
          <div class="feeLeftTitle">{{feeLeftTitle}}</div>
          <!-- 上方订单信息表单 -->
          <div class="feeLeftTopBox">
            <div class="feeLeftTopTitle">订单信息</div>
            <el-form ref="orderInfoForm" :model="orderInfoForm" label-width="110px" size="mini" class="orderInfo">
              <el-row>
                <el-col :span="24">
                  <el-form-item label="订单号:" prop="ODC_CODE">
                    <el-input v-model="orderInfoForm.ODC_CODE" clearable disabled></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item label="客户:" prop="ODC_CLT_NAME">
                    <el-input v-model="orderInfoForm.ODC_CLT_NAME" clearable disabled></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item label="起始港/站:" prop="ODC_LOADPORT_NAME">
                    <el-input v-model="orderInfoForm.ODC_LOADPORT_NAME" clearable disabled></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item label="目的港/站:" prop="ODC_DESTINATIONPORT">
                    <el-input v-model="orderInfoForm.ODC_DESTINATIONPORT" clearable disabled></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item label="委托人:" prop="ODC_CONSIGNER">
                    <el-input v-model="orderInfoForm.ODC_CONSIGNER" clearable disabled></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item label="联系人:" prop="ODC_LINKPERSON">
                    <el-input v-model="orderInfoForm.ODC_LINKPERSON" clearable disabled></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item label="联系电话:" prop="ODC_LINKPHONE">
                    <el-input v-model="orderInfoForm.ODC_LINKPHONE" clearable disabled></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-form>
          </div>
          <!-- 增值服务表格 -->
          <div class="feeLeftBotBox">
            <div class="feeLeftBotTitle">增值服务</div>
            <el-table :data="addValueServeData" border :height="addValueServeHeight" :header-cell-style="{ textAlign: 'center' }" @row-click="getAddValueData" highlight-current-row style="margin-top: 20px">
              <el-table-column type="index" align="center" label=" " width="50"></el-table-column>
              <el-table-column prop="optSequence" v-if="this.feeDialogTitle == '应收费用管理'" label="序列" width="80" show-overflow-tooltip sortable></el-table-column>
              <el-table-column prop="optWfsupplierName" v-if="this.feeDialogTitle == '应付费用管理'" label="物流供应商" width="150" show-overflow-tooltip sortable></el-table-column>
              <el-table-column prop="optTypeName" v-if="this.feeDialogTitle == '应收费用管理'" label="类型" show-overflow-tooltip sortable ></el-table-column>
              <el-table-column prop="optTypeName" v-if="this.feeDialogTitle == '应付费用管理'" label="类型" show-overflow-tooltip sortable ></el-table-column>
            </el-table>
          </div>
        </div>
        <!-- 右侧 -->
        <div class="feeRightBox">
          <div class="feeRightTopBox">
            <div class="feeRightTopTitle">费目明细</div>
            <!-- 费目明细按钮组 -->
            <div class="feeRightBtnBox">
              <el-button plain size="mini" type="success" @click="feeDetailAdd">新增</el-button>
              <el-button plain size="mini" type="danger" @click="feeDetailDel">删除</el-button>
              <el-button plain size="mini" type="primary" @click="feeDetailMoney">统计金额</el-button>
            </div>
            <!-- 费目明细表格 -->
            <el-table :data="feeDetailTableData" border :height="feeDetailTableHeight" :header-cell-style="{ textAlign: 'center' }" @row-click="getFeeDetailData" highlight-current-row>
              <el-table-column type="index" align="center" label=" " width="50"></el-table-column>
              <el-table-column prop="msiBill" label="费目" width="180px" show-overflow-tooltip>
                <template slot-scope="scope">
                  <span v-if="scope.row.status" style="color: blue" @click="showSecondDialog">{{scope.row.msiBill}}</span>
                  <span v-else style="color: black">{{scope.row.msiBill}}</span>
                </template>
              </el-table-column>
              <el-table-column prop="msiUnit" label="单位" show-overflow-tooltip >
                <template slot-scope="scope">
                  <el-select v-model="scope.row.msiUnit" filterable clearable size="mini">
                    <el-option
                      style="padding: 0"
                      v-for="item in priceUnitList"
                      :key="item.rvLowValue"
                      :label="item.rvCmeaning"
                      :value="item.rvLowValue">
                    </el-option>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column prop="msiCtntype" label="箱型" show-overflow-tooltip >
                <template slot-scope="scope">
                  <el-select v-model="scope.row.msiCtntype" filterable clearable size="mini">
                    <el-option
                      v-for="(item,index) in boxList"
                      :key="index"
                      :label="item.ctpCommcode"
                      :value="item.ctpCommcode"
                      style="padding: 0"
                    ></el-option>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column prop="msiCtnsize" label="尺寸" show-overflow-tooltip >
                <template slot-scope="scope">
                  <el-select v-model="scope.row.msiCtnsize" filterable clearable size="mini">
                    <el-option
                      v-for="(item,index) in sizeList"
                      :key="index"
                      :label="item.cszCsizenm"
                      :value="item.cszCsizenm"
                      style="padding: 0"
                    ></el-option>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column prop="msiCamt" label="数量" show-overflow-tooltip  >
                <template slot-scope="scope">
                  <el-input v-model="scope.row.msiCamt" @input="numChange" clearable size="mini"></el-input>
                </template>
              </el-table-column>
              <el-table-column prop="msiPrice" label="单价" show-overflow-tooltip >
                <template slot-scope="scope">
                  <el-input v-model="scope.row.msiPrice" clearable size="mini"></el-input>
                </template>
              </el-table-column>
              <el-table-column prop="msiPprice" label="参考价" show-overflow-tooltip ></el-table-column>
              <el-table-column prop="money" label="金额" show-overflow-tooltip ></el-table-column>
              <el-table-column prop="msiCurrency" label="币种" show-overflow-tooltip ></el-table-column>
            </el-table>
          </div>
          <div class="feeRightBotBox">
            <div class="feeRightBotTitle">统计信息</div>
            <!-- 统计信息表格 -->
            <el-table :data="totalInfoTableData" border :height="totalInfoTableHeight" :header-cell-style="{ textAlign: 'center' }"
              :cell-style="{ textAlign: 'center' }" highlight-current-row style="margin-top: 20px">
              <el-table-column type="index" align="center" label=" " width="50"></el-table-column>
              <el-table-column prop="moneyCate" label="币种" show-overflow-tooltip ></el-table-column>
              <el-table-column prop="totalNum" label="累计数量" show-overflow-tooltip ></el-table-column>
              <el-table-column prop="totalMoney" label="累计金额" show-overflow-tooltip ></el-table-column>
            </el-table>
          </div>
        </div>
      </div>

      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="feeDialog = false">关闭</el-button>
        <el-button size="mini" type="primary" @click="feeDialogSave">保存</el-button>
      </span>
    </el-dialog>

    <!-- 费目明细点击选择后 二级弹窗 -->
    <el-dialog :title="secondDialogTitle" :visible.sync="secondDialog" width="40%" style="top: 12vh" :close-on-click-modal='false' v-el-drag-dialog @close="secondClose">
      <secondComponent :sendMsg="sendMsg" :sendComponentData="sendComponentData" :sendData="sendData" @secondChildData="secondChildData"></secondComponent>
    </el-dialog>

    <!-- 主页下方 操作服务信息新增按钮 弹窗 -->
    <el-dialog title="订单操作" :visible.sync="optServeInfoDialog" width="35%" :close-on-click-modal='false' style="top: 20%" v-el-drag-dialog>
      <div class="orderOptBox">
        <div class="orderOptTitle">基础信息</div>
        <el-form ref="orderBasicForm" :model="orderBasicForm" :rules="orderBasicRules" label-width="90px"  :inline="true" size="mini">
          <el-row>
            <el-col :span="12">
              <el-form-item label="操作类型:" prop="optType">
                <el-select v-model="orderBasicForm.optType" filterable clearable>
                  <el-option
                    v-for="item in czlxitem"
                    :key="item.RV_LOW_VALUE"
                    :label="item.RV_CMEANING"
                    :value="item.RV_LOW_VALUE"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="操作序列:" prop="optSequence">
                <el-input v-model="orderBasicForm.optSequence"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="起始港:" prop="optStartplace">
                <el-select v-model="orderBasicForm.optStartplace" filterable clearable>
                  <el-option
                    v-for="item in qsgData"
                    :key="item.CODE"
                    :label="item.NAME"
                    :value="item.CODE"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="目的港:" prop="optEndplace">
                <el-select v-model="orderBasicForm.optEndplace" filterable clearable>
                  <el-option
                    v-for="item in qsgData"
                    :key="item.CODE"
                    :label="item.NAME"
                    :value="item.CODE"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="22">
              <el-form-item label="备注:" prop="optRemark">
                <el-input type="textarea" v-model="orderBasicForm.optRemark" style="width: 450px"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="optServeInfoDialog = false">取消</el-button>
        <el-button size="mini" type="primary" @click="orderOptSure('orderBasicForm')">确定</el-button>
      </span>
    </el-dialog>

    <!-- 主页下方 服务动态列表动态录入弹窗 -->
    <el-dialog :title="dynamicTitle" :visible.sync="dynamicDialog" v-if="dynamicDialog" width="40%" style="top: 12vh" :close-on-click-modal='false' v-el-drag-dialog>
      <el-form ref="dynamicForm" :model="dynamicForm" :rules="dynamicRules" label-width="90px"  :inline="true" size="mini">
        <el-row>
          <el-col :span="12">
            <el-form-item label="作业动态:" prop="lacOpprc">
              <el-popover placement="bottom" width="500" v-model="boxD" trigger="manual">
                <selectedComponent :selectMsg="selectMsg"  @dynamic='dynamic'></selectedComponent>
                <div class="el-input el-select el-input--mini el-input--suffix" slot="reference">
                  <el-input v-model="dynamicForm.lacOpprc" @blur="basicClose" @focus="workDynamicMsg" clearable size="mini"></el-input>
                  <span class="el-input__suffix">
                    <span class="el-input__suffix-inner">
                      <i class="el-select__caret el-input__icon " :class="isShow4?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
                    </span>
                  </span>
                </div>
              </el-popover>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="作业时间:" prop="lacOptm">
              <el-date-picker v-model="dynamicForm.lacOptm" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="是否发布:" prop="lacFb">
              <el-select v-model="dynamicForm.lacFb" filterable clearable>
                <el-option
                  v-for="item in sffbList"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="作业地点:" prop="lacAddress">
              <el-input v-model="dynamicForm.lacAddress" clearable style="width: 450px"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="22">
            <el-form-item label="内容:" prop="lacContent">
              <el-input type="textarea" v-model="dynamicForm.lacContent" style="width: 500px;"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="22">
            <el-form-item label="备注:" prop="lacRemark">
              <el-input type="textarea" v-model="dynamicForm.lacRemark" style="width: 500px"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="dynamicDialog = false">取消</el-button>
        <el-button size="mini" type="primary" @click="dynamicSave">保存</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import {
  theOrderManageKhxy,
  theOrderManageDdzt,
  createUserListMethod,
  getDataListMethod,
  theOrderManageDdQsd,
  theOrderManageDdQsg,
  theOrderManageDCc,
  theOrderManageDXX,
  theOrderManageDXZ,
  theOrderManageDHW,
  theOrderManageDBZ,
  theOrderManageSheng,
  theOrderManageShi,
  theOrderManageQu,
  theOrderManageBj,
  theOrderManageBJList,
  theOrderManageDetailsList,
  theOrderManageDetailsdel,
  theOrderManageCzlx,
  theOrderManageDetailsAdd,
  theOrderManageFwList,
  theOrderManageBcList,
  theOrderManageQxdd,
  theOrderManagedel,
  theOrderManageDdsh,
  theOrderManageBjeidt,
  theOrderManageyxqdel,
  theOrderManageyxqFb,
  theOrderManageDdKh,
  theOrderManageYsfl,
  getSizeService,
  getBoxService,
  getShouldGetService,
  getShouldFeeDetailService,
  getSelectDown,
  getShouldFeeSaveService,
  delFeeDetailService,
  getShouldPayFeeSaveService,
  getAgreeListService
} from '@/request/api'
import resizeMixin from '@/mixins/resize'
import paginationMixin from '@/mixins/pagination'
import secondComponent from './secondComponent'
import selectedComponent from './selectedComponent'
export default {
  name: 'router.theOrderManage',
  mixins: [resizeMixin, paginationMixin],
  data() {
    return {
      sendMsg: '', // 传给 选择费目弹窗  的分辨值
      sendData: [], // 传给 选择费目弹窗  的费目明细  表格数据
      dialogSaveA:false,
      diong:'E',
      diongBj:'A',
      box:false,
      boxA:false,
      boxB:false,
      boxC:false,
      boxD:false,
      searchForm: {
        ordId: '', // 订单号
        odcConsigner: '', // 委托人
        odcStatus: '', // 订单状态
        ordCreatetimeStart: '', // 下单时间  开始
        ordCreatetimeEnd: '', // 下单时间  结束
        odcCreator: '', // 创建人
        ordIshydc: '', // 复选框
        ordIsblpz:''
      },
      sffbList:[
        {code:'Y',name:'是'},
        {code:'N',name:'否'}
      ],
      statusLists:[], //订单状态下拉框数据
      ysflItem:[], // 运输分类
      createUserList:[],//创建人下拉框
      placeLists: [], // 起始地，目的地下拉框数据
      statusPlace: [], // 状态下拉框数据
      mainTopTableData: [], // 主页上方 解决方案表格数据
      mainTopHeight: 380, // 主页上方 表格高度
      mainBotTableData: [], // 主页下方 订单详情表格数据
      mainBotTableDataA:[],
      mainBotHeight: 200, // 主页下方 订单详情表格高度
      activeNames: ['1'], // 控制主页下方 解决方案明细表格的展示
      activeName: 'first', // 控制主页下方tab栏切换

      dialogStatus: '', // 判断弹窗是点击哪个弹出
      dialogTitle: '', // 新增弹窗标题
      mainDialog: false, // 控制新增弹窗的出现与隐藏
      basicForm:[],
      basicRules: {
        odcEmail:[
          {
            pattern: /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/,
            message: '请输入正确的Email',
            trigger: 'blur'
          }
        ],
        odcCltId: [
          { required: true, message: '请选择客户', trigger: 'change' },
        ],
        odcConsigner: [
          { required: true, message: '请输入委托人', trigger: ['blur','change'] },
        ],
        orGoodowner: [
          { required: true, message: '请输入货主', trigger: ['blur','change'] },
        ],
        odcLinkperson: [
          { required: true, message: '请输入联系人', trigger: ['blur','change'] },
        ],
        orShipper: [
          { required: true, message: '请选择发货方', trigger: 'change' },
        ],
        orShippercontacts: [
          { required: true, message: '请输入发货方联系人', trigger: ['blur','change'] },
        ],
        orShippertel: [
          { required: true, message: '请输入发货方联系方式', trigger: ['blur','change'] },
        ],
        orReveivingparty: [
          { required: true, message: '请选择收货方', trigger: 'change'},
        ],
        orReveivingpartycontacts: [
          { required: true, message: '请输入收货方联系人', trigger: ['blur','change'] },
        ],
        orReveivingpartytel: [
          { required: true, message: '请输入收货方联系方式', trigger: ['blur','change'] },
        ],
      },
      // 服务信息表单
      serveForm: {
        solveMethods: '', // 解决方案
        odcWorktime: '', // 作业天数
        orTransportsort: '', // 运输分类
        orIE: '1', // 进出口
        orStartplace: '', // 起始地
        orEndplace: '', // 目的地
        odcLoadport: '', // 起始港站
        odcDestinationport: '', // 目的港站
      },
      serveRules: {
        odcWorktime: [
          { required: true, message: '请输入作业天数', trigger: ['blur','change'] },
        ],
        orTransportsort: [
          { required: true, message: '运输分类不能为空', trigger: ['blur','change'] },
        ],
        orIE: [
          { required: true, message: '请选择进出口', trigger: 'blur' },
        ],
        orStartplace: [
          { required: true, message: '请选择起始地', trigger: 'change' },
        ],
        orEndplace: [
          { required: true, message: '请选择目的地', trigger: 'change' },
        ],
        odcLoadport: [
          { required: true, message: '请选择起始港站', trigger: 'change' },
        ],
        odcDestinationport: [
          { required: true, message: '请选择目的港站', trigger: 'change' },
        ],
      },
      transPortDisabled: true, // 控制新增弹窗 服务信息 运输分类下拉禁止输入
      serveTableData: [], // 服务信息表格数据
      serveTableHeight: 180, // 服务信息表格高度
      solveTableData: [], // 解决方案明细表格数据
      solveTableHeight: 160, // 解决方案明细表格高度
      goodsTableData: [], // 货物信息表格数据
      goodsTableHeight: 160, // 货物信息表格高度
      // 拖车服务  发货地服务
      startCarForm: {
        odcSPeople: '', // 联系人
        odcSPhone: '', // 联系电话
        odcSProvince: '', // 地址   省
        orDeliverypointcity: '', // 地址   市
        odcSArea: '', // 地址   区县
        odcSAddress: '', // 详细地址
      },
      // 拖车服务  目的地服务
      endCarForm: {
        odcDPeople: '', // 联系人
        odcDPhone: '', // 联系电话
        odcDProvince: '', // 地址   省
        orReveivingpartytelcity: '', // 地址   市
        odcDArea: '', // 地址   区县
        odcDAddress: '', // 详细地址
      },

      endCarRulesA:{
        tayIeflag: [
          { required: true, message: '中文品名不能为空', trigger: 'blur' },
        ],
        tayTaskmodels: [
          { required: true, message: '件数不能为空', trigger: 'blur' },
        ],
        tayStates: [
          { required: true, message: '重量不能为空', trigger: 'blur' },
        ],
      },
      startChecked: false, // 控制发货地拖车勾选框
      endChecked: false, // 控制目的地拖车勾选框
      startDisabled: true, // 控制发货地输入框禁止输入
      endDisabled: true, // 控制目的地输入框禁止输入
      // 协议费用信息
      agreeFeeForm: {
        V_ODC_CLIENTXY: '', // 客户协议
        V_ODC_YSTOTALFEE: '', // 订单总金额(RMB)
        orderUSD: '', // 订单总金额(USD)
      },
      V_ORD_AUDITDIFFERING: '', // 审核意见
      customerID: '', // 客户ID

      // 费收弹窗
      moneyCateTitle: '', // 选择币种弹窗  标题
      moneyCateDialog: false, // 控制选择币种弹窗展示
      moneyCateRadio: 'RMB', // 费用管理弹窗选择币种
      feeDialog: false, // 控制费收弹窗展示
      feeDialogTitle: '', // 费收弹窗标题
      feeLeftTitle: '', // 费收弹窗左上方标题
      orderInfoForm: {
        ODC_CODE: '', // 订单号
        ODC_CLT_NAME: '', // 客户
        ODC_LOADPORT_NAME: '', // 起始港站
        ODC_DESTINATIONPORT: '', // 目的港站
        ODC_CONSIGNER: '', // 委托人
        ODC_LINKPERSON: '', // 联系人
        ODC_LINKPHONE: '', // 联系电话
      },
      addValueServeData: [], // 增值服务表格数据
      addValueServeHeight: 240, // 增值服务表格高度
      feeDetailTableData: [], // 费目明细表格数据
      feeDetailTableHeight: 280, // 费目明细表格高度
      totalInfoTableData: [], // 统计信息表格数据
      totalInfoTableHeight: 220, // 统计信息表格高度

      // 操作服务信息新增弹窗
      optServeInfoDialog: false, // 控制操作服务信息新增弹窗展示
      orderBasicForm: {
        optType: '', // 操作类型
        optSequence: '', // 操作序列
        optStartplace: '', // 起始港
        optEndplace: '', // 目的港
        optRemark: '', // 备注
      },
      orderBasicRules: {
        optType: [
          { required: true, message: '操作类型不能为空', trigger: 'blur' },
        ],
        optStartplace: [
          { required: true, message: '起始港不能为空', trigger: 'blur' },
        ],
        optEndplace: [
          { required: true, message: '目的港不能为空', trigger: 'blur' },
        ],
      },
      // 服务动态列表 动态录入弹窗
      dynamicDialog: false, // 控制服务动态列表 动态录入弹窗展示
      dynamicTitle: '', // 服务动态列表 动态录入弹窗标题
      dynamicForm: {
        lacOpprc: '', // 作业动态
        lacOptm: '', // 作业时间
        lacFb: '', // 是否发布
        lacAddress: '', // 作业地点
        lacContent: '', // 内容
        lacRemark: '', // 备注
      },
      dynamicRules: {
        lacOpprc: [
          { required: true, message: '作业动态不能为空', trigger: 'change' },
        ],
        lacOptm: [
          { required: true, message: '作业时间不能为空', trigger: 'blur' },
        ],
        lacFb: [
          { required: true, message: '是否发布不能为空', trigger: 'change' },
        ],
        lacAddress: [
          { required: true, message: '作业地点不能为空', trigger: 'blur' },
        ],
      },

      // 二级弹窗
      secondDialog: false, // 控制二级弹窗是否展示
      secondDialogTitle: '', // 控制二级弹窗标题
      agreeList: [], // 客户协议下拉框  数据

      // 下拉框是表格的相关操作
      isShow:false,
      isShow1:false,
      isShow2:false,
      isShow3:false,
      isShow4:false,
      selectMsg:'',
      khData:[], // 客户 发货方 收货方 下拉框数据
      qsdData:[], //起始地 目的地 下拉框
      qsgData:[], // 起始港 目的港下拉框
      ccData:[], // 尺寸下拉框
      xxData:[], // 箱型下拉框
      hwData:[], // 货物分类下拉框
      bzData:[], // 包装下拉框
      provinceData:[],//省下拉框
      cityData:[],//市下拉框
      cityDataA:[],//市下拉框
      townData:[], // 区县下拉框
      townDataA:[], // 区县下拉框
      itemData:[], //子组件传过来的数据
      rowData:[],//箱信息当前行数据,
      rowDataA:[],//货物信息当前行数据
      bjRowData:[],
      boxData:[],
      mainBotRowClickData:[],
      mainBotRowClickADataA:[],
      czlxitem:[],
      boxtype:[],
      itemType:[],
      sizeList: [], // 尺寸 下拉框数据
      boxList: [], // 箱型 下拉框数据
      priceUnitList: [], // 计价单位
      feeDetailCurrentData: '', // 费目明细 当前行数据
      addValueCurrentData: '', // 增值服务 当前行数据
      sendComponentData: []
    }
  },
  computed: {
    startCarRules(){
      let required = this.startChecked
      return {
        odcSPeople: [
          { required, message: '联系人不能为空', trigger: 'blur' },
        ],
        odcSPhone: [
          { required, message: '联系电话不能为空', trigger: 'blur' },
        ],
        odcSProvince: [
          { required, message: '省份不能为空', trigger: ['blur','change'] },
        ],
        orDeliverypointcity: [
          { required, message: '市不能为空', trigger: ['blur','change'] },
        ],
        odcSArea: [
          { required, message: '区县不能为空', trigger: ['blur','change'] },
        ],
      }
    },
    endCarRules(){
      let required = this.endChecked
      return {
        odcDPeople: [
          { required, message: '联系人不能为空', trigger: 'blur' },
        ],
        odcDPhone: [
          { required, message: '联系电话不能为空', trigger: 'blur' },
        ],
        odcDProvince: [
          { required, message: '省份不能为空', trigger: ['blur','change'] },
        ],
        orReveivingpartytelcity: [
          { required, message: '市不能为空', trigger: ['blur','change'] },
        ],
        odcDArea: [
          { required, message: '区县不能为空', trigger: ['blur','change'] },
        ]
      }
    }
  },

  components: {
    secondComponent,
    selectedComponent
  },
  watch: {
    boxD () {
      if (this.boxD) {
        this.selectMsg = 'workDynamic'
      }
    },
    startChecked() {
      if(this.startChecked == false) {
        this.startDisabled = true
      }else {
        this.startDisabled = false
      }
    },

    endChecked() {
      if(this.endChecked == false) {
        this.endDisabled = true
      }else {
        this.endDisabled = false
      }
    },
  },
  mounted() {
    this.getSelectData()
    this.dingData()
    this.CJData()
    this.qsData()
    this.qsgDataA()
    this.ccDataA()
    this.xxDataA()
    this.HWData()
    this.BZData()
    this.shengData()
    this.czlxData()
    this.ysflData()
    this.KhxyData()
    // this.typeDataShi()
  },
  created() {
    this.refreshList()
    this.boxtypeA()
  },
  methods: {
    // 统计金额
    feeDetailMoney() {
      if(this.feeDetailTableData.length == 0) {
        this.$alert('当前没有费目','提示',{
          confirmButtonText: '确定'
        })
        return
      }
      let newArr = []
      let allNum = 0
      let allMoney = 0
      this.feeDetailTableData.forEach(item => {
        if(item.msiCamt == 0 || item.msiCamt == null) {
          newArr.push(item)
        }
        if(item.msiCamt) {
          allNum += item.msiCamt
        }
        if(item.money) {
          allMoney += item.money
        }
      })
      if(newArr.length > 0) {
        this.$alert('费目明细的金额不能为空','提示',{
          confirmButtonText: '确定'
        })
        return
      }
      if(this.totalInfoTableData[0]) {
        this.totalInfoTableData.shift(0)
      }
      if(this.feeDetailTableData[0].msiCurrency == 'RMB') {
        let list = {
          moneyCate: 'RMB',
          totalNum: allNum,
          totalMoney: allMoney
        }
        this.totalInfoTableData.unshift(list)
      }
    },
    // 费收弹窗关闭事件
    dialogClose() {
      this.addValueCurrentData = ''
    },
    //客户协议下拉框  未对接  测试说先不弄  需求未明确
    KhxyData(){
      theOrderManageKhxy().then(res=>{
        console.log(res,88888)
        this.agreementList = res.data
      })
    },
    //运输分类
    ysflData(){
      theOrderManageYsfl().then(res=>{
        this.ysflItem = res.data
      })
    },
    //请求客户下拉框数据
    boxtypeA(){
      theOrderManageDdKh().then(res=>{
        this.boxtype = res.data
      })
    },
    mainTopRowClick(row){
      this.bjRowData = row
      this.itemB()
      this.itemC()
    },
    //请求下半部分 操作服务信息
    itemB(){
      theOrderManageDetailsList({ordId:this.bjRowData.ORD_ID}).then(res=>{
        this.mainBotTableData = res.data
      })
    },
    //请求下半部分 服务动态列表
    itemC(){
      theOrderManageFwList({lac_ord_id:this.bjRowData.ORD_ID}).then(res=>{
        this.mainBotTableDataA = res.data
      })
    },
    //动态录入点击保存
    dynamicSave(){
      this.$refs.dynamicForm.validate(valid => {
        if(valid) {
          if(this.diongBj == 'A'){
            let typeData = Object.assign({lacId:this.mainBotRowClickADataA[0].LAC_ID},this.dynamicForm)
            theOrderManageBjeidt(typeData).then(()=>{
              this.$message({
                type: 'success',
                message: '编辑成功'
              })
              this.dynamicDialog = false
              this.itemC()
            })
          }else{
            this.dynamicForm.ordId = this.bjRowData.ORD_ID
            theOrderManageBcList (this.dynamicForm).then(() =>{
              this.$message({
                type: 'success',
                message: '添加成功'
              })
              this.dynamicDialog = false
              this.itemC()
            })
          }

        }
      })
    },

    //编辑
    itemA(){

      theOrderManageBj({odcId:this.bjRowData.ODC_ID}).then(res=>{
        this.customerID = res.data.conCltId
        this.boxData = res.data
        this.basicForm = res.data.basicInfo // 基础信息
        this.serveForm = {
          solveMethods: res.data.serviceInfo.proInfo.PDT_NAME,//服务信息  解决方案
          odcWorktime: res.data.serviceInfo.proInfo.PDT_DATE, //服务信息 //作业天数
          orTransportsort: res.data.serviceInfo.proInfo.PDT_TRANSPORTATIONSORT, //服务信息 运输分类
          orIE:res.data.serviceInfo.proInfo.PDT_I_E, //服务信息 进出口
          orStartplace:res.data.serviceInfo.proInfo.PDT_START, //服务信息 起始地
          orEndplace:res.data.serviceInfo.proInfo.PDT_DESTI, //服务信息 目的地
          odcLoadport:res.data.serviceInfo.proInfo.PDT_STARTADDRESS, //服务信息 起始港
          odcDestinationport:res.data.serviceInfo.proInfo.PDT_DESTINATION, //服务信息 目的港
        }
        this.solveTableData = res.data.serviceInfo.proInfo.detailList //解决方案明细
        this.serveTableData = res.data.Amount.map(v=>{
          v.status = 1
          return v
        }) //箱信息
        this.goodsTableData = res.data.Goods.map(v => {
          v.status = 1
          return v
        }) //货物信息

        this.provinceChange(res.data.Send.odcSProvince)
        this.cityChange(res.data.Send.orDeliverypointcity)
        this.provinceChangeA(res.data.Reveiv.odcDProvince)
        this.cityChangeA(res.data.Reveiv.orReveivingpartytelcity)
        this.goodsTableData.godCode = res.data.Goods.godGoodtype
        this.goodsTableData.godPacked =res.data.Goods.godGoodtype
        this.startCarForm = res.data.Send // 发货地服务信息
        this.startCarForm.orDeliverypointcity = res.data.Send.orDeliverypointcity // 发货地服务信息
        this.startCarForm.odcSArea = res.data.Send.odcSArea // 发货地服务信息
        this.endCarForm = res.data.Reveiv // 收货地服务信息
        this.endCarForm.orReveivingpartytelcity = res.data.Reveiv.orReveivingpartytelcity
        this.endCarForm.odcDArea = res.data.Reveiv.odcDArea
        this.basicForm.odcCltId = this.searchItem(this.boxtype,this.basicForm)
      })
    },
    //循环遍历客户id 相等赋值name
    searchItem(obj,arr){
      let name = ''
      for(var i=0;i<obj.length;i++){
        let ele= obj[i]
        if(ele.CLT_ID == arr.odcCltId ){
          name = ele.CLT_NAME
        }
      }
      return name
    },
    //下方操作服务信息表格当前行
    mainBotRowClick(row){
      this.mainBotRowClickData = row
    },
    //下方服务动态列表表格当前行
    // mainBotRowClickA(row){
    //   console.log(row)
    //   this.mainBotRowClickADataA = row
    // },
    //勾选下方服务动态列表表格当前行
    handleSelectionChange(val){
      this.mainBotRowClickADataA = val
    },
    //点击删除
    optServiceDel(){
      if(Object.keys(this.mainBotRowClickData).length == 0){
        this.$alert('请选择需要删除的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      theOrderManageDetailsdel({V_OOP_ID:this.mainBotRowClickData.OOP_ID,V_OPT_ID:this.mainBotRowClickData.OPT_ID}).then(()=>{
        this.$message({
          type: 'success',
          message: '删除成功'
        })
        this.itemB()
      })
    },
    //操作类型下拉框
    czlxData(){
      theOrderManageCzlx({doMain:'操作类型'}).then(res=>{
        this.czlxitem = res.data
      })
    },
    checkboxChange(val){
      this.searchForm.ordIshydc = val ? 'Y' :''
    },
    checkboxChangeA(val){
      this.searchForm.ordIsblpz = val ? 'Y' : ''
    },
    dingData(){
      theOrderManageDdzt({rvDomain:'订单状态'}).then(res =>{
        this.statusLists = res.data
      })
    },
    //发货省下拉框
    shengData(){
      theOrderManageSheng({ctycd:''}).then(res=>{
        this.provinceData = res.data
      })
    },
    //发货市下拉框
    provinceChange(data){
      theOrderManageShi({pvCode:data}).then(res=>{
        this.cityDataA = res.data
      })
    },
    //发货区县下拉框
    cityChange(data){
      theOrderManageQu({prvcode:data}).then(res=>{
        this.townDataA = res.data
      })
    },
    //目的市下拉框
    provinceChangeA(data){
      theOrderManageShi({pvCode:data}).then(res=>{
        this.cityData = res.data
      })
    },
    //目的区县下拉框
    cityChangeA(data){
      theOrderManageQu({prvcode:data}).then(res=>{
        this.townData  = res.data
      })
    },
    //创建人下拉框
    CJData(){
      createUserListMethod().then(res =>{
        this.createUserList = res.data
      })
    },
    //起始地  目的地 下拉框
    qsData(){
      theOrderManageDdQsd().then(res=>{
        this.placeLists = res.data
      })
    },
    //起始港 和 目的港 下拉框
    qsgDataA(){
      theOrderManageDdQsg().then(res=>{
        this.qsgData = res.data
      })
    },
    //尺寸下拉框
    ccDataA(){
      theOrderManageDCc({cszCsizecd:'',cszCsizenm:'',cszName:''}).then(res=>{
        this.ccData = res.data.FTKJWLHYPT
      })
    },
    // 箱型下拉框
    xxDataA(){
      theOrderManageDXX({ctpCommcode:'',ctpName:''}).then(res=>{
        this.xxData = res.data.FTKJWLHYPT
      })
    },
    //
    // 货物分类下拉框
    HWData(){
      theOrderManageDHW().then(res=>{
        this.hwData = res.data
      })
    },
    BZData(){
      theOrderManageDBZ().then(res=>{
        this.bzData = res.data
      })
    },
    //获取列表数据
    getList(currentPage, pageSize, updateTotal) {
      getDataListMethod({
        odcCode: this.searchForm.odcCode, // 订单号
        odcConsigner:this.searchForm.odcConsigner, // 委托人
        odcStatus: this.searchForm.odcStatus, // 订单状态
        ordCreatetimeStart: this.searchForm.ordCreatetimeStart, // 下单时间  开始
        ordCreatetimeEnd: this.searchForm.ordCreatetimeEnd, // 下单时间  结束
        odcCreator: this.searchForm.odcCreator, // 创建人
        ordIshydc: this.searchForm.ordIshydc, // 复选框
        ordIsblpz:this.searchForm.ordIsblpz,
        PageIndexs:this.Pagination.currentPage.toString(),
        PageSizes:this.Pagination.pageSize.toString()
      }).then(response => {
        this.mainTopTableData = response.data.FTKJWLHYPT
        updateTotal(Number(response.data.total.FTKJWLHYPT))
      })
    },
    //查询
    search(){
      this.refreshList()
    },
    //客户
    childFnw(data ,obj){
      this.customerID = data.CLT_ID
      this.itemData = data
      this.basicForm.odcCltId = data.CLT_NAME
      this.basicForm.odcConsigner = data.CLT_NAME
      this.basicForm.orGoodowner = data.CLT_NAME
      this.basicForm.odcLinkperson = data.CLT_CONTACT
      this.basicForm.odcLinkphone = data.CLT_CTCTEL
      this.basicForm.odcTel  = data.CLT_CTCTEL
      this.box = obj
    },
    //发货方
    childFnA(data,obj){
      this.basicForm.orShipper = data.CLT_NAME
      this.basicForm.orShippercontacts = data. CLT_CONTACT
      this.basicForm.orShippertel = data.CLT_CTCTEL
      this.boxA = obj
    },
    //收货方
    childFnB(data, obj){
      this.basicForm.orReveivingparty = data.CLT_NAME
      this.basicForm.orReveivingpartycontacts = data. CLT_CONTACT
      this.basicForm.orReveivingpartytel = data.CLT_CTCTEL
      this.boxB = obj
    },
    //解决方案
    service(data,obj){
      this.itemType = data
      this.serveForm.solveMethods = data.PDT_NAME //解决方案
      this.serveForm.odcWorktime =data.PDT_DATE   //作业天数
      this.serveForm.orTransportsort = data.PDT_TRANSPORTATIONSORT  //运输分类
      this.serveForm.orIE  = data.PDT_I_E     //进出口
      this.serveForm.orStartplace = data.PDT_START  //起始地
      this.serveForm.orEndplace = data.PDT_DESTI    //目的地
      this.serveForm.odcLoadport = data.PDT_STARTADDRESS  //起始港
      this.serveForm.odcDestinationport  = data.PDT_DESTINATION //目的港
      this.solveTableData = data.detailList  // 解决方案明细列表数据
      this.serveTableData = data.ctnList.map(v =>{
        let type = {
          taaCntrtype:v.PTP_TYPE,
          taaCntrsize:v.PTP_SIZE,
          taaQuantity:v.CTN_NUM,
          status:1
        }
        return  type
      }) //箱信息   箱型

      this.boxC = obj
    },
    //作业动态
    dynamic(data,obj){
      this.dynamicForm.lacOpprc = data.RV_CMEANING
      this.dynamicForm.lacOpprcCode = data.RV_LOW_VALUE
      this.boxD = obj
    },
    // 下拉框为表格的焦点获取事件
    // 客户
    customerMsg() {
      this.box = !this.box
      this.selectMsg = 'customer'
    },
    // 发货方
    sendGoodsMsg() {
      this.boxA = !this.boxA
      this.selectMsg = 'sendGoods'
    },
    // 收货方
    getGoodsMsg() {
      this.boxB = !this.boxB
      this.selectMsg = 'getGoods'
    },
    // 解决方案
    solveMethodsMsg() {
      this.selectMsg = 'solveMethods'
      this.boxC = !this.boxC
    },
    // 作业动态
    workDynamicMsg() {
      this.selectMsg = 'workDynamic'
      this.boxD = !this.boxD
    },
    // 主页新增订单
    add() {
      this.mainDialog = true
      this.dialogTitle = '新增订单信息'
      this.dialogStatus = 'add'
      this.dialogSaveA = true
      this.diong = 'E'
      //基础信息
      this.basicForm = {
        odcCltId: '', // 客户
        odcConsigner: '', // 委托人
        orGoodowner: '', // 货主
        odcLinkperson: '', // 联系人
        odcLinkphone: '', // 联系电话
        odcTel: '', // 手机
        odcEmail: '', // email
        odcQq: '', // qq
        odcWechat: '', // 微信
        orShipper: '', // 发货方
        orShippercontacts: '', // 发货方联系人
        orShippertel: '', // 发货方联系方式
        orReveivingparty: '', // 收货方
        orReveivingpartycontacts: '', // 收货方联系人
        orReveivingpartytel: '', // 收货方联系方式
        odcRemark: '', // 备注
      },
      // 服务信息表单
      this.serveForm={
        solveMethods: '', // 解决方案
        odcWorktime: '', // 作业天数
        orTransportsort: '', // 运输分类
        orIE: '1', // 进出口
        orStartplace: '', // 起始地
        orEndplace: '', // 目的地
        odcLoadport: '', // 起始港站
        odcDestinationport: '', // 目的港站
      },
      //箱信息
      this.serveTableData = []
      // 拖车服务  发货地服务
      this.startCarForm= {
        odcSPeople: '', // 联系人
        odcSPhone: '', // 联系电话
        odcSProvince: '', // 地址   省
        orDeliverypointcity: '', // 地址   市
        odcSArea: '', // 地址   区县
        odcSAddress: '', // 详细地址
      },
      // 拖车服务  目的地服务
      this.endCarForm={
        odcDPeople: '', // 联系人
        odcDPhone: '', // 联系电话
        odcDProvince: '', // 地址   省
        orReveivingpartytelcity: '', // 地址   市
        odcDArea: '', // 地址   区县
        odcDAddress: '', // 详细地址
      },
      this.goodsTableData = [] //货物信息
      if(Object.keys(this.startCarForm).length == 0){
        this.startChecked = false
      }
      if(Object.keys(this.endCarForm).length == 0){
        this.endChecked = false
      }
    },
    // 主页修改订单
    edit() {
      if(Object.keys(this.bjRowData).length == 0){
        this.$alert('请选择需要修改的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '已审核'){
        this.$alert('未审核的订单才能编辑，无法编辑！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '订单关闭'){
        this.$alert('未审核的订单才能编辑，无法编辑！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '取消订单'){
        this.$alert('未审核的订单才能编辑，无法编辑！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }

      this.dialogTitle = '编辑订单信息'
      this.dialogStatus = 'edit'
      this.dialogSaveA = true
      this.mainDialog = true
      this.diong= ''
      this.itemA()
      if(Object.keys(this.startCarForm).length > 0){

        this.startChecked = true
      }
      if(Object.keys(this.endCarForm).length > 0){
        this.endChecked = true
      }
    },
    // 主页取消订单
    del() {
      if(Object.keys(this.bjRowData).length == 0){
        this.$alert('请选择需要取消的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '订单关闭'){
        this.$alert('该订单已在作业中，无法取消！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '审核拒绝'){
        this.$alert('该订单已在作业中，无法取消！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '已审核'){
        this.$alert('该订单已在作业中，无法取消！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '取消订单'){
        this.$alert('订单已取消，不可再次取消订单！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '未审核'){
        this.$alert('确定要取消订单吗？', '提示', {
          confirmButtonText: '确定'
        }).then(()=>{
          theOrderManageQxdd({ordId:this.bjRowData.ORD_ID}).then(()=>{
            this.$message ({
              type: 'success',
              message: '取消成功'
            })
            this.refreshList()
          })
        })
      }


    },
    // 主页订单审核
    audit() {
      if(Object.keys(this.bjRowData).length == 0){
        this.$alert('请选择需要审核的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '订单关闭'){
        this.$alert('不是未审核的订单，无法审核！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '审核拒绝'){
        this.$alert('不是未审核的订单，无法审核！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '取消订单'){
        this.$alert('不是未审核的订单，无法审核！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '已审核'){
        this.$alert('不是未审核的订单，无法审核！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }

      this.dialogTitle = '确认审核'
      this.dialogStatus = 'audit'
      this.itemA()
      console.log(this.customerID)
      this.dialogSaveA = false
      this.mainDialog = true
      if(Object.keys(this.startCarForm).length > 0){

        this.startChecked = true
      }
      if(Object.keys(this.endCarForm).length > 0){
        this.endChecked = true
      }
    },
    // 主页取消审核
    delAudit() {
      if(Object.keys(this.bjRowData).length == 0){
        this.$alert('请选择需要取消审核的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '取消订单'){
        this.$alert('不是审核的订单，无法审核！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '订单关闭'){
        this.$alert('不是审核的订单，无法取消审核！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '审核拒绝'){
        this.$alert('不是审核的订单，无法取消审核！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '未审核'){
        this.$alert('不是审核的订单，无法取消审核！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.dialogTitle = '取消审核'
      this.dialogStatus = 'delAudit'
      this.itemA()
      this.dialogSaveA = false
      this.mainDialog = true
      if(Object.keys(this.startCarForm).length > 0){

        this.startChecked = true
      }
      if(Object.keys(this.endCarForm).length > 0){
        this.endChecked = true
      }
    },
    // 主页删除订单
    delOrder() {
      if(Object.keys(this.bjRowData).length == 0){
        this.$alert('请选择需要删除的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '订单关闭'){
        this.$alert('当前订单未取消，无法删除！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '审核拒绝'){
        this.$alert('当前订单未取消，无法删除！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '已审核'){
        this.$alert('当前订单未取消，无法删除！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '未审核'){
        this.$alert('当前订单未取消，无法删除！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '取消订单'){
        this.$alert('确定要删除订单吗？', '提示', {
          confirmButtonText: '确定'
        }).then(()=>{
          theOrderManagedel({V_ORD_ID:this.bjRowData.ORD_ID}).then(()=>{
            this.$message ({
              type: 'success',
              message: '删除成功'
            })
            this.refreshList()
          })
        })

      }
    },
    // 主页应收费用管理
    shouldGet() {
      if(Object.keys(this.bjRowData).length == 0){
        this.$alert('请选择一条数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME == '未审核') {
        this.$alert('当前状态未审核，无法结费', '提示', {
          confirmButtonText: '确定'
        })
        return
      }

      this.moneyCateTitle = '应收费用管理-选择币种'
      this.moneyCateDialog = true
      this.feeLeftTitle = '应收费用信息'
      this.orderInfoForm = this.bjRowData
      getShouldGetService({lacOrdId: this.bjRowData.ORD_ID}).then(res => {
        if(res.success == 1) {
          this.addValueServeData = res.data.FTKJWLHYPT
        }
        console.log(res)
      })
    },
    // 主页应付费用管理
    shouldPay() {
      if(Object.keys(this.bjRowData).length == 0){
        this.$alert('请选择一条数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.bjRowData.ORD_STATUS_NAME != '订单关闭') {
        this.$alert('当前状态未关闭，无法结费', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.orderInfoForm = this.bjRowData
      this.moneyCateTitle = '应付费用管理-选择币种'
      this.moneyCateDialog = true
      this.feeLeftTitle = '应付费用信息'
      getShouldGetService({lacOrdId: this.bjRowData.ORD_ID}).then(res => {
        if(res.success == 1) {
          this.addValueServeData = res.data.FTKJWLHYPT
        }
        console.log(res)
      })
    },
    // 获取增值服务当前行数据
    getAddValueData(row) {
      this.addValueCurrentData = row
      if(this.feeDialogTitle == '应付费用管理') {
        getShouldFeeDetailService({currency: 'RMB',mslBpsign: 'EF',mslFltId: this.bjRowData.ORD_ETP_ID,mslOrdId: this.bjRowData.ORD_ID,mslOptType: row.optType}).then(res => {
          if(res.success == 1) {
            this.feeDetailTableData = res.data.FTKJWLHYPT
            this.sendData = this.feeDetailTableData
          }
        })
      }
      console.log(this.addValueCurrentData)
    },
    // 接收  二级弹窗  子组件传过来的值
    secondChildData(val) {
      console.log(val)
      if(val.msiCchId) {
        this.feeDetailTableData.shift(0)
        this.feeDetailTableData[0] = val
        this.feeDetailTableData[0].status = 0
        this.feeDetailTableData[0].msiPprice = val.msiPrice
        this.secondDialog = val.closeDialog
      }else {
        this.secondDialog = val.closeDialog
        let nameArr = []
        this.feeDetailTableData.forEach(items => {
          nameArr.push(items.msiBill)
        })
        let newArr = val.feeDetailData.filter(item => {
          return (nameArr.indexOf(item.msiBill) == -1)
        })
        this.feeDetailTableData.shift(0)
        newArr.forEach(feeItem => {
          this.feeDetailTableData.push(feeItem)
        })
      }
    },
    // 获取费目明细当前行数据
    getFeeDetailData(row) {
      this.feeDetailCurrentData = row
      console.log(row)
    },
    // 改变数量值   判断金额
    numChange(val) {
      this.feeDetailCurrentData.money = val * (this.feeDetailCurrentData.msiPrice)
      console.log(this.feeDetailCurrentData)
    },
    // 应收费用管理   保存  按钮
    feeDialogSave() {
      if(this.feeDialogTitle == '应收费用管理') {
        if(this.feeDetailTableData.length > 0) {
          let newArr = this.feeDetailTableData.filter(item => {
            return item.msiBill == '选择' || Boolean(item.msiUnit) == false || Boolean(item.msiCtntype) == false || Boolean(item.msiCtnsize) == false || Boolean(item.msiCamt) == false || Boolean(item.msiPrice) == false
          })
          if(newArr.length > 0){
            this.$alert('费目，单位，箱型，尺寸，数量，单价不能为空！', '提示', {
              confirmButtonText: '确定'
            })
            return
          }
        }
        let needData = Object.assign({},{mslFltId: this.bjRowData.ORD_ETP_ID,mslOrdId: this.bjRowData.ORD_ID,mslBpsign: 'IF'},{sysTmsMarshlingItemsList: this.feeDetailTableData})
        getShouldFeeSaveService(needData).then(res => {
          if(res.success == 1) {
            this.$message({
              type: 'success',
              message: '应收结费成功'
            })
            this.feeDialog = false
            this.refreshList()
          }
        })
      }else if(this.feeDialogTitle == '应付费用管理') {
        if(this.feeDetailTableData.length > 0) {
          let newArr = this.feeDetailTableData.filter(item => {
            return item.msiBill == '选择' || Boolean(item.msiUnit) == false || Boolean(item.msiCtntype) == false || Boolean(item.msiCtnsize) == false || Boolean(item.msiCamt) == false || Boolean(item.msiPrice) == false
          })
          if(newArr.length > 0){
            this.$alert('费目，单位，箱型，尺寸，数量，单价不能为空！', '提示', {
              confirmButtonText: '确定'
            })
            return
          }
        }
        if(Object.keys(this.addValueCurrentData).length == 0) {
          this.$alert('请选择物流供应商','提示',{
            confirmButtonText: '确定'
          })
          return
        }
        let needData = Object.assign({},{mslFltId: this.bjRowData.ORD_ETP_ID,mslOrdId: this.bjRowData.ORD_ID,mslBpsign: 'EF'},{sysTmsMarshlingItemsList: this.feeDetailTableData},{mslJchbPaycstId: this.addValueCurrentData.optWfsupplier,mslJpayer: this.addValueCurrentData.optWfsupplierName,optType: this.addValueCurrentData.optType})
        console.log(needData)
        getShouldPayFeeSaveService(needData).then(res => {
          if(res.success == 1) {
            this.$message({
              type: 'success',
              message: '应付结费成功'
            })
            this.feeDialog = false
            this.refreshList()
          }
        })
      }
    },
    // 费目明细  删除  按钮
    feeDetailDel() {
      if(Object.keys(this.feeDetailCurrentData).length == 0) {
        this.$alert('请选择一条数据','提示',{
          confirmButtonText: '确定'
        })
        return
      }
      this.$confirm('您确认要删除选定的数据?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        if(this.feeDetailCurrentData.msiId == null) {
          this.feeDetailTableData = this.feeDetailTableData.filter(item => {
            return item != this.feeDetailCurrentData
          })
        }else {
          delFeeDetailService({msiId: this.feeDetailCurrentData.msiId}).then(res => {
            if(res.success == 1) {
              this.$message({
                type: 'success',
                message: '删除成功!'
              })
              this.feeDetailTableData = this.feeDetailTableData.filter(item => {
                return item != this.feeDetailCurrentData
              })
            }
          })
        }
      }).catch(() => {
      })
    },
    // 新增弹窗 箱信息 新增按钮
    serveAdd() {
      let list = {
        status: 1
      }
      this.serveTableData.unshift(list)
    },
    //箱信息删除按钮
    serveDel(){
      this.serveTableData =  this.serveTableData.filter(item => {
        return item != this.rowData
      })
      this.rowData = ''
    },
    //箱信息当前行数据
    mainTopRowClickA(row){
      this.rowData = row
    },
    //货物信息当前行数据
    mainTopRowClickAB(row){
      this.rowDataA = row
    },
    // 新增弹窗 货物信息 新增按钮
    goodsAdd() {
      let list = {
        status: 1
      }
      this.goodsTableData.unshift(list)
    },
    // 新增弹窗 货物信息 删除按钮
    goodsDel(){
      this.goodsTableData =  this.goodsTableData.filter(item => {
        return item != this.rowDataA
      })
      this.rowDataA = ''
    },
    // 监听弹窗关闭
    basicClose() {
      this.dialogStatus = ''
      this.box = false
      this.boxA=false
      this.boxB=false
      this.boxC=false
      this.boxD=false
    },
    secondClose() {
      this.sendComponentData = ''
    },
    // 费用管理弹窗的币种选择 确定按钮
    moneyCateSure() {
      if(this.moneyCateTitle == '应收费用管理-选择币种' && this.moneyCateRadio == 'RMB') {
        this.moneyCateDialog = false
        this.feeDialogTitle = '应收费用管理'
        this.feeLeftTitle = '应收人民币费用信息'
        this.sendMsg = 'shouldGetRMB'
        this.feeDialog = true
        getShouldFeeDetailService({currency: 'RMB',mslBpsign: 'IF',mslFltId: this.bjRowData.ORD_ETP_ID,mslOrdId: this.bjRowData.ORD_ID}).then(res => {
          if(res.success == 1) {
            this.feeDetailTableData = res.data.FTKJWLHYPT
            this.sendData = this.feeDetailTableData
          }
          console.log(res)
        })
      }else if(this.moneyCateTitle == '应收费用管理-选择币种' && this.moneyCateRadio == 'USD') {
        this.moneyCateDialog = false
        this.feeDialogTitle = '应收费用管理'
        this.feeLeftTitle = '应收美金费用信息'
        this.sendMsg = 'shouldGetUSD'
        this.feeDialog = true
        getShouldFeeDetailService({currency: 'USD',mslBpsign: 'IF',mslFltId: this.bjRowData.ORD_ETP_ID,mslOrdId: this.bjRowData.ORD_ID}).then(res => {
          if(res.success == 1) {
            this.feeDetailTableData = res.data.FTKJWLHYPT
            this.sendData = this.feeDetailTableData
          }
          console.log(res)
        })
      }else if(this.moneyCateTitle == '应付费用管理-选择币种' && this.moneyCateRadio == 'RMB') {
        this.moneyCateDialog = false
        this.feeDialogTitle = '应付费用管理'
        this.feeLeftTitle = '应付人民币费用信息'
        this.sendMsg = 'shouldPayRMB'
        this.feeDialog = true
        getShouldFeeDetailService({currency: 'RMB',mslBpsign: 'EF',mslFltId: this.bjRowData.ORD_ETP_ID,mslOrdId: this.bjRowData.ORD_ID,mslOptType: ''}).then(res => {
          if(res.success == 1) {
            this.feeDetailTableData = res.data.FTKJWLHYPT
            this.sendData = this.feeDetailTableData
          }
          console.log(res)
        })
      }else if(this.moneyCateTitle == '应付费用管理-选择币种' && this.moneyCateRadio == 'USD') {
        this.moneyCateDialog = false
        this.feeDialogTitle = '应付费用管理'
        this.feeLeftTitle = '应付美金费用信息'
        this.sendMsg = 'shouldPayUSD'
        this.feeDialog = true
        getShouldFeeDetailService({currency: 'USD',mslBpsign: 'EF',mslFltId: this.bjRowData.ORD_ETP_ID,mslOrdId: this.bjRowData.ORD_ID,mslOptType: ''}).then(res => {
          if(res.success == 1) {
            this.feeDetailTableData = res.data.FTKJWLHYPT
            this.sendData = this.feeDetailTableData
          }
          console.log(res)
        })
      }
    },
    // 费目弹窗右侧费目明细新增按钮
    feeDetailAdd() {
      let list = {
        status: 1,
        msiBill: '选择'
      }
      this.feeDetailTableData.unshift(list)
    },
    // 点击费目明细列表的 选择 按钮展示二级弹窗
    showSecondDialog() {
      this.secondDialogTitle = '选择费目'
      this.secondDialog = true
    },
    // 监听主页下方表格的展示
    handleChange(val) {
      if(val.length == 0) {
        this.mainTopHeight = 660
      }else {
        this.mainTopHeight = 380
      }
    },
    // 弹窗保存按钮
    dialogSave() {
      this.$refs.basicForm.validate((valid) => {
        if (valid) {
          this.$refs.serveForm.validate((validA)=>{
            if(validA){
              this.$refs.startCarForm.validate((validB)=>{
                if(validB){
                  this.$refs.endCarForm.validate((validC)=>{
                    if(validC){
                      if(this.diong == 'E'){
                        let taaData = ''
                        this.serveTableData.forEach(item =>{
                          taaData = item.taaQuantity
                        })
                        if(taaData == 0){
                          this.$alert('箱数据必须大于0!', '提示', {
                            confirmButtonText: '确定'
                          })
                          return
                        }
                        let typeData = Object.assign(
                          this.basicForm,
                          this.serveForm,
                          {Amount:this.serveTableData},
                          this.solveTableData,
                          {Goods:this.goodsTableData},
                          this.startCarForm,
                          this.endCarForm,
                          {odcCltId:this.itemData.CLT_ID},
                          {odcPdtId:this.itemType.PDT_ID}
                        )
                        theOrderManageDXZ (typeData).then(() =>{
                          this.$message({
                            type: 'success',
                            message: '添加成功'
                          })
                          this.mainDialog = false
                          this.refreshList()
                        })
                      }else{
                        let typeData = Object.assign(
                          this.basicForm,
                          this.serveForm,
                          {Amount:this.serveTableData},
                          this.solveTableData,
                          {Goods:this.goodsTableData},
                          this.startCarForm,
                          this.endCarForm,
                          {odcCltId:this.itemData.CLT_ID},
                          {odcPdtId:this.itemType.PDT_ID}
                        )
                        theOrderManageBJList(typeData).then(()=>{
                          this.$message({
                            type: 'success',
                            message: '编辑成功'
                          })
                          this.mainDialog = false
                          this.refreshList()
                        })
                      }
                    }
                  })
                }
              })
            }
          })
        }
      })
    },
    //弹窗审核按钮
    dialogAudit(){
      let typeData = Object.assign(
        this.agreeFeeForm,
        {V_ORD_AUDITDIFFERING:this.V_ORD_AUDITDIFFERING},
        {V_ORD_STATUS:'1'},
        {V_ORD_ID:this.bjRowData.ORD_ID}
      )
      theOrderManageDdsh(typeData).then(()=>{
        this.$message({
          type: 'success',
          message: '审核成功'
        })
        this.mainDialog = false
        this.refreshList()
      })
    },
    //取消审核
    dialogDelAudit(){

      let typeData = Object.assign(
        this.agreeFeeForm,
        {V_ORD_AUDITDIFFERING:this.V_ORD_AUDITDIFFERING},
        // {V_ORD_STATUS:this.bjRowData.ORD_STATUS_NAME},
        {V_ORD_STATUS:'0'},
        {V_ORD_ID:this.bjRowData.ORD_ID}
      )
      theOrderManageDdsh(typeData).then(()=>{
        this.$message({
          type: 'success',
          message: '取消审核成功'
        })
        this.mainDialog = false
        this.refreshList()
      })
    },
    //拒绝审核
    dialogRefuse(){
      if(this.dialogStatus == 'audit'){
        this.$alert('您确定要拒绝订单吗？拒绝后不可恢复！', '提示', {
          confirmButtonText: '确定'
        }).then(()=>{
          let typeData = Object.assign(
            this.agreeFeeForm,
            {V_ORD_AUDITDIFFERING:this.V_ORD_AUDITDIFFERING},
            // {V_ORD_STATUS:this.bjRowData.ORD_STATUS_NAME},
            {V_ORD_STATUS:'2'},
            {V_ORD_ID:this.bjRowData.ORD_ID}
          )
          theOrderManageDdsh(typeData).then(()=>{
            this.$message({
              type: 'success',
              message: '拒绝审核成功'
            })
            this.mainDialog = false
            this.refreshList()
          })
        })
      }else if(this.dialogStatus == 'delAudit'){
        this.$alert('您确定要拒绝订单吗？拒绝后不可恢复！', '提示', {
          confirmButtonText: '确定'
        }).then(()=>{
          let typeData = Object.assign(
            this.agreeFeeForm,
            {V_ORD_AUDITDIFFERING:this.V_ORD_AUDITDIFFERING},
            // {V_ORD_STATUS:this.bjRowData.ORD_STATUS_NAME},
            {V_ORD_STATUS:'2'},
            {V_ORD_ID:this.bjRowData.ORD_ID}
          )
          theOrderManageDdsh(typeData).then(()=>{
            this.$message({
              type: 'success',
              message: '拒绝审核成功'
            })
            this.mainDialog = false
            this.refreshList()
          })
        })
      }

    },
    // 主页  下方表格  操作服务信息新增按钮
    optServiceAddA() {
      if(Object.keys(this.bjRowData).length == 0){
        this.$alert('请先选择一条数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.orderBasicForm = {
        optType:'',
        optSequence: '', // 操作序列
        optStartplace: '', // 起始港
        optEndplace: '', // 目的港
        optRemark: '', // 备注
      }
      this.optServeInfoDialog = true
    },
    // 主页  下方表格  操作服务信息新增保存按钮
    orderOptSure(){
      this.$refs.orderBasicForm.validate(valid => {
        if(valid) {
          let typeData = Object.assign({optOrdcode:this.bjRowData.ORD_CODE},this.orderBasicForm)
          typeData.ordId=this.bjRowData.ORD_ID
          typeData.optEtpId=this.bjRowData.ODC_ETP_ID,
          typeData.optDepId=this.bjRowData.ODC_DEP_Id,
          theOrderManageDetailsAdd (typeData).then(() =>{
            this.$message({
              type: 'success',
              message: '添加成功'
            })
            this.optServeInfoDialog = false
            this.itemB()
          })
        }
      })
    },
    // 主页  下方表格  服务动态列表 动态录入按钮
    dynamicBtn() {
      if(Object.keys(this.bjRowData).length == 0){
        this.$alert('请先选择一条数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.dynamicTitle = '动态录入'
      this.dynamicDialog = true
      this.diongBj = ''
      this.dynamicForm={
        lacOpprc: '', // 作业动态
        lacOptm: '', // 作业时间
        lacFb: '', // 是否发布
        lacAddress: '', // 作业地点
        lacContent: '', // 内容
        lacRemark: '', // 备注
      }
    },
    // 主页  下方表格  服务动态列表 动态编辑按钮
    dynamicEdit() {
      if(Object.keys(this.mainBotRowClickADataA).length == 0){
        this.$alert('请先选择需要编辑的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.mainBotRowClickADataA.length > 1){
        this.$alert('每次只能修改一行数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.dynamicTitle = '动态编辑'
      this.dynamicDialog = true
      this.diongBj = 'A'
      this.dynamicForm.lacOpprc = this.mainBotRowClickADataA[0].LAC_OPPRC
      this.dynamicForm.lacOptm = this.mainBotRowClickADataA[0].LAC_OPTM
      this.dynamicForm.lacFb = this.mainBotRowClickADataA[0].LAC_FB
      this.dynamicForm.lacAddress = this.mainBotRowClickADataA[0].LAC_ADDRESS
      this.dynamicForm.lacContent = this.mainBotRowClickADataA[0].LAC_CONTENT
      this.dynamicForm.lacRemark = this.mainBotRowClickADataA[0].LAC_REMARK
    },
    //动态删除
    dynamicDel(){
      if(Object.keys(this.mainBotRowClickADataA).length == 0){
        this.$alert('请先选择需要删除的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      if(this.mainBotRowClickADataA.length > 1){
        this.$alert('请选择您要删除的数据!且只能选择一行', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.$alert('您确认要删除此数据吗？', '提示', {
        confirmButtonText: '确定'
      }).then(()=>{
        theOrderManageyxqdel({lacId:this.mainBotRowClickADataA[0].LAC_ID}).then(()=>{
          this.$message({
            type: 'success',
            message: '删除成功'
          })
          this.itemC()
        })
      })

    },
    //一键发布
    dynamicYifb(){
      if(Object.keys(this.mainBotRowClickADataA).length == 0){
        this.$alert('请先选择需要发布的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }

      var arr= this.mainBotTableDataA.find(res => {
        return res.LAC_FB == 'Y'
      })
      if(arr.LAC_FB){
        this.$alert('该信息已发布，不可重复发布！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      let type= []
      this.mainBotRowClickADataA.forEach(item =>{
        type.push(item.LAC_ID)
      })
      let obj = Object.assign({lacIdStr:type.join(','),lacFb:'Y'})
      theOrderManageyxqFb(obj).then(()=>{
        this.$message({
          type: 'success',
          message: '发布成功'
        })
        this.itemC()
      })
    },
    //取消发布
    dynamicQxfb(){
      if(Object.keys(this.mainBotRowClickADataA).length == 0){
        this.$alert('请先选择需要取消发布的数据！', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      this.$alert('您确定要取消发布吗?', '提示', {
        confirmButtonText: '确定'
      }).then(()=>{
        let type= []
        this.mainBotRowClickADataA.forEach(item =>{
          type.push(item.LAC_ID)
        })
        let obj = Object.assign({lacIdStr:type.join(','),lacFb:'N'},this.box)
        theOrderManageyxqFb(obj).then(()=>{
          this.$message({
            type: 'success',
            message: '取消成功'
          })
          this.itemC()
        })
      })

    },
    // 下拉框数据
    getSelectData() {
      // 尺寸
      getSizeService().then(res => {
        if(res.success == 1) {
          this.sizeList = res.data.FTKJWLHYPT
        }
      })
      // 箱型
      getBoxService().then(res => {
        if(res.success == 1) {
          this.boxList = res.data.FTKJWLHYPT
        }
      })
      getSelectDown({rvDomain: '计价单位'}).then(res => {
        if(res.success == 1) {
          this.priceUnitList = res.data.FTKJWLHYPT
        }
      })
      getAgreeListService({conCltId: this.customerID}).then(res => {
        console.log(res)
        if(res.success == 1) {
          this.agreeList = res.data.FTKJWLHYPT
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.solveManage {
  .topForm {
    padding-top: 10px;
  }
  .btnBox {
    padding-left: 10px;
  }
  .tableBox {
    .topTable {
      padding-top: 10px;
    }
    .block {
      height: 40px;
    }
    ::v-deep .botTable {
      .el-collapse-item__header {
        padding-left: 10px;
      }
      .el-collapse-item__content {
        padding-bottom: 0;
      }
      .optServiceInfo {
        padding-left: 10px;
        margin-bottom: 5px;
      }
    }
  }
}
// 弹窗内的样式
.dialogBox {
  width: 100%;
  // height: 700px;
  .basicBox {
    width: 100%;
    height: 340px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    ::v-deep .el-select {
      .el-input__inner {
        width: 178px;
      }
    }
  }
  .serveBox {
    width: 100%;
    height: 280px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    .serveContent {
      margin-top: 50px;
      width: 100%;
      height: 218px;
      display: flex;
      justify-content: space-between;
      // background-color: #175993;
      .serveContentLeft {
        width: 60%;
        height: 100%;
        border-right: 1px solid #ccc;
        // background-color: #175993;
      }
      .serveContentRight {
        width: 39%;
        height: 100%;
        // background-color: aqua;
        .srBtnBox {
          margin-bottom: 5px;
        }
      }
    }
  }
  .solveMethodsDetailBox {
    width: 100%;
    height: 220px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
  }
  .goodsInfoBox {
    width: 100%;
    height: 280px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    .goodsBtnBox {
      padding-left: 15px;
      margin-bottom: 15px;
    }
  }
  .truckServiceBox {
    width: 100%;
    height: 260px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    .serviceBox {
      width: 100%;
      height: 195px;
      display: flex;
      justify-content: center;
      align-items: center;
      .startBox {
        width: 50%;
        height: 100%;
        border-right: 1px solid #ccc;
        .startTitle {
          padding-left: 10px;
          font-weight: 600;
          color: #000;
        }
        .detailAddressBox {
          ::v-deep .el-input__inner {
            width: 430px;
          }
        }
        ::v-deep .el-input__inner {
          width: 140px;
        }
      }
      .endBox {
        width: 50%;
        height: 100%;
        .endTitle {
          padding-left: 10px;
          font-weight: 600;
          color: #000;
        }
        .detailAddressBox {
          ::v-deep .el-input__inner {
            width: 430px;
          }
        }
        ::v-deep .el-input__inner {
          width: 140px;
        }
      }
    }
  }
  .attachmentInfoBox {
    width: 100%;
    height: 200px;
    border: 1px solid #ccc;
  }
  .agreeFeeInfoBox {
    margin: 20px 0;
    height: 110px;
    width: 100%;
    border: 1px solid #ccc;
  }
  .auditInfoBox {
    width: 100%;
    height: 130px;
    border: 1px solid #ccc;
    .auditInfoBot {
      width: 100%;
      // height: 80px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 400px 0 20px;
    }
  }
}
// 费收弹窗样式
.feeDialogBox {
  height: 600px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  .feeLeftBox {
    width: 32%;
    height: 100%;
    border: 1px solid #ccc;
    position: relative;
    .feeLeftTitle {
      position: absolute;
      background-color: #fff;
      width: 130px;
      top: -12px;
      color: #000;
    }
    .feeLeftTopBox {
      height: 280px;
      width: 100%;
      border: 1px solid #ccc;
      margin-top: 20px;
      position: relative;
      padding: 10px 10px 0 0;
      .feeLeftTopTitle {
        position: absolute;
        top: -12px;
        background-color: #fff;
      }
      ::v-deep .orderInfo {
        .el-input__inner {
          border: none;
          background-color: #fff;
          color: blue;
        }
        .el-form-item {
          margin-bottom: 10px !important;
        }
      }
    }
    .feeLeftBotBox {
      height: 283px;
      width: 100%;
      margin-top: 15px;
      border: 1px solid #ccc;
      position: relative;
      .feeLeftBotTitle {
        position: absolute;
        top: -12px;
        background-color: #fff;
      }
    }
  }
  .feeRightBox {
    width: 67%;
    height: 100%;
    .feeRightTopBox {
      position: relative;
      width: 100%;
      height: 345px;
      border: 1px solid #ccc;
      .feeRightTopTitle {
        position: absolute;
        top: -12px;
        background-color: #fff;
      }
      .feeRightBtnBox {
        margin-top: 20px;
        padding-left: 15px;
        margin-bottom: 20px;
      }
    }
    .feeRightBotBox {
      position: relative;
      width: 100%;
      height: 240px;
      border: 1px solid #ccc;
      margin-top: 15px;
      .feeRightBotTitle {
        position: absolute;
        top: -12px;
        background-color: #fff;
      }
    }
  }
}
// 操作服务信息新增弹窗样式
.orderOptBox {
  width: 100%;
  height: 200px;
  border: 1px solid #ccc;
  position: relative;
  padding-top: 30px;
  .orderOptTitle {
    position: absolute;
    top: -12px;
    background-color: #fff;
  }
  ::v-deep .el-input__inner {
    width: 178px;
  }
}

::v-deep .searchBox {
  .el-form-item {
    display: flex;
    justify-content: space-between;
  }
  .el-checkbox {
    padding-top: 6px;
    margin-right: 0;
  }
  .el-form-item__label {
    padding: 0;
  }
  .el-input__inner {
    width: 144px;
  }
}
::v-deep .el-dialog {
  margin-top: 5vh !important;
}

// 弹窗标题样式
.basicTitle {
  width: 100%;
  // border: 1px solid #dfdfdf;
  border-bottom: 1px solid #ccc;
  box-shadow: 0 0 10px #ccc;
  position: relative;
  display: block;
  float: left;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.basicTitle span {
  width: 150px;
  height: 50px;
  display: block;
  float: left;
  font-size: 18px;
  color: #fff;
  background: #175993;
  text-align: center;
  line-height: 50px;
}
.basicTitle .icon {
  width: 50px;
  height: 50px;
  background: #175993;
  display: block;
  float: left;
  span {
    color: #fff;
    font-size: 3rem;
    text-align: left;
    padding-left: 1.4rem;
  }
}
.basicTitle .order_span2 {
  width: auto;
  height: 50px;
  padding: 0px 15px;
  display: block;
  float: left;
  font-size: 18px;
  background: none;
  color: #33495e;
  text-align: center;
  line-height: 50px;
  font-weight: bold;
}
::v-deep .feeRightTopBox .el-table .cell.el-tooltip {
  padding: 0;
}
</style>
